plotly-2.2.3+dfsg.orig/0000755000175000017500000000000013211605515014246 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/0000755000175000017500000000000013211605515015571 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/colors.py0000644000175000017500000005264713207065466017474 0ustar noahfxnoahfx""" colors ===== Functions that manipulate colors and arrays of colors. ----- There are three basic types of color types: rgb, hex and tuple: rgb - An rgb color is a string of the form 'rgb(a,b,c)' where a, b and c are integers between 0 and 255 inclusive. hex - A hex color is a string of the form '#xxxxxx' where each x is a character that belongs to the set [0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f]. This is just the set of characters used in the hexadecimal numeric system. tuple - A tuple color is a 3-tuple of the form (a,b,c) where a, b and c are floats between 0 and 1 inclusive. ----- Types of colormap: There are typically two main types of colormaps that exist: numerical and categorical colormaps. Numerical colormaps are used when a the coloring column being used takes a spectrum of values or numbers. Alternatively, a categorical colormap is used to assign a specific value in a color column to a specific color everytime it appears in the plot at hand. For instance, a column of strings in a dataframe would naturally use a categorical colormap. You can choose however to use a categorical colormap with a column of numbers. Be careful though, as if you have a large set of unique numbers in your column you'll get a lot of colors. """ from __future__ import absolute_import import decimal from numbers import Number from plotly import exceptions 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)'] PLOTLY_SCALES = { 'Greys': [ [0, 'rgb(0,0,0)'], [1, 'rgb(255,255,255)'] ], 'YlGnBu': [ [0, 'rgb(8,29,88)'], [0.125, 'rgb(37,52,148)'], [0.25, 'rgb(34,94,168)'], [0.375, 'rgb(29,145,192)'], [0.5, 'rgb(65,182,196)'], [0.625, 'rgb(127,205,187)'], [0.75, 'rgb(199,233,180)'], [0.875, 'rgb(237,248,217)'], [1, 'rgb(255,255,217)'] ], 'Greens': [ [0, 'rgb(0,68,27)'], [0.125, 'rgb(0,109,44)'], [0.25, 'rgb(35,139,69)'], [0.375, 'rgb(65,171,93)'], [0.5, 'rgb(116,196,118)'], [0.625, 'rgb(161,217,155)'], [0.75, 'rgb(199,233,192)'], [0.875, 'rgb(229,245,224)'], [1, 'rgb(247,252,245)'] ], 'YlOrRd': [ [0, 'rgb(128,0,38)'], [0.125, 'rgb(189,0,38)'], [0.25, 'rgb(227,26,28)'], [0.375, 'rgb(252,78,42)'], [0.5, 'rgb(253,141,60)'], [0.625, 'rgb(254,178,76)'], [0.75, 'rgb(254,217,118)'], [0.875, 'rgb(255,237,160)'], [1, 'rgb(255,255,204)'] ], 'Bluered': [ [0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)'] ], # modified RdBu based on # www.sandia.gov/~kmorel/documents/ColorMaps/ColorMapsExpanded.pdf 'RdBu': [ [0, 'rgb(5,10,172)'], [0.35, 'rgb(106,137,247)'], [0.5, 'rgb(190,190,190)'], [0.6, 'rgb(220,170,132)'], [0.7, 'rgb(230,145,90)'], [1, 'rgb(178,10,28)'] ], # Scale for non-negative numeric values 'Reds': [ [0, 'rgb(220,220,220)'], [0.2, 'rgb(245,195,157)'], [0.4, 'rgb(245,160,105)'], [1, 'rgb(178,10,28)'] ], # Scale for non-positive numeric values 'Blues': [ [0, 'rgb(5,10,172)'], [0.35, 'rgb(40,60,190)'], [0.5, 'rgb(70,100,245)'], [0.6, 'rgb(90,120,245)'], [0.7, 'rgb(106,137,247)'], [1, 'rgb(220,220,220)'] ], 'Picnic': [ [0, 'rgb(0,0,255)'], [0.1, 'rgb(51,153,255)'], [0.2, 'rgb(102,204,255)'], [0.3, 'rgb(153,204,255)'], [0.4, 'rgb(204,204,255)'], [0.5, 'rgb(255,255,255)'], [0.6, 'rgb(255,204,255)'], [0.7, 'rgb(255,153,255)'], [0.8, 'rgb(255,102,204)'], [0.9, 'rgb(255,102,102)'], [1, 'rgb(255,0,0)'] ], 'Rainbow': [ [0, 'rgb(150,0,90)'], [0.125, 'rgb(0,0,200)'], [0.25, 'rgb(0,25,255)'], [0.375, 'rgb(0,152,255)'], [0.5, 'rgb(44,255,150)'], [0.625, 'rgb(151,255,0)'], [0.75, 'rgb(255,234,0)'], [0.875, 'rgb(255,111,0)'], [1, 'rgb(255,0,0)'] ], 'Portland': [ [0, 'rgb(12,51,131)'], [0.25, 'rgb(10,136,186)'], [0.5, 'rgb(242,211,56)'], [0.75, 'rgb(242,143,56)'], [1, 'rgb(217,30,30)'] ], 'Jet': [ [0, 'rgb(0,0,131)'], [0.125, 'rgb(0,60,170)'], [0.375, 'rgb(5,255,255)'], [0.625, 'rgb(255,255,0)'], [0.875, 'rgb(250,0,0)'], [1, 'rgb(128,0,0)'] ], 'Hot': [ [0, 'rgb(0,0,0)'], [0.3, 'rgb(230,0,0)'], [0.6, 'rgb(255,210,0)'], [1, 'rgb(255,255,255)'] ], 'Blackbody': [ [0, 'rgb(0,0,0)'], [0.2, 'rgb(230,0,0)'], [0.4, 'rgb(230,210,0)'], [0.7, 'rgb(255,255,255)'], [1, 'rgb(160,200,255)'] ], 'Earth': [ [0, 'rgb(0,0,130)'], [0.1, 'rgb(0,180,180)'], [0.2, 'rgb(40,210,40)'], [0.4, 'rgb(230,230,50)'], [0.6, 'rgb(120,70,20)'], [1, 'rgb(255,255,255)'] ], 'Electric': [ [0, 'rgb(0,0,0)'], [0.15, 'rgb(30,0,100)'], [0.4, 'rgb(120,0,100)'], [0.6, 'rgb(160,90,0)'], [0.8, 'rgb(230,200,0)'], [1, 'rgb(255,250,220)'] ], 'Viridis': [ [0, '#440154'], [0.06274509803921569, '#48186a'], [0.12549019607843137, '#472d7b'], [0.18823529411764706, '#424086'], [0.25098039215686274, '#3b528b'], [0.3137254901960784, '#33638d'], [0.3764705882352941, '#2c728e'], [0.4392156862745098, '#26828e'], [0.5019607843137255, '#21918c'], [0.5647058823529412, '#1fa088'], [0.6274509803921569, '#28ae80'], [0.6901960784313725, '#3fbc73'], [0.7529411764705882, '#5ec962'], [0.8156862745098039, '#84d44b'], [0.8784313725490196, '#addc30'], [0.9411764705882353, '#d8e219'], [1, '#fde725'] ] } def color_parser(colors, function): """ Takes color(s) and a function and applies the function on the color(s) In particular, this function identifies whether the given color object is an iterable or not and applies the given color-parsing function to the color or iterable of colors. If given an iterable, it will only be able to work with it if all items in the iterable are of the same type - rgb string, hex string or tuple """ if isinstance(colors, str): return function(colors) if isinstance(colors, tuple) and isinstance(colors[0], Number): return function(colors) if hasattr(colors, '__iter__'): if isinstance(colors, tuple): new_color_tuple = tuple(function(item) for item in colors) return new_color_tuple else: new_color_list = [function(item) for item in colors] return new_color_list def validate_colors(colors): """ Validates color(s) and returns an error for invalid color(s) :param (str|tuple|list) colors: either a plotly scale name, an rgb or hex color, a color tuple or a list/tuple of colors """ colors_list = [] # if colors is a single color, put into colors_list if isinstance(colors, str): if colors in PLOTLY_SCALES: return elif 'rgb' in colors or '#' in colors: colors_list.append(colors) else: raise exceptions.PlotlyError( 'If your colors variable is a string, it must be a ' 'Plotly scale, an rgb color or a hex color.' ) elif isinstance(colors, tuple): if isinstance(colors[0], Number): colors_list = [colors] else: colors_list = list(colors) if isinstance(colors, dict): colors_list.extend(colors.values()) elif isinstance(colors, list): colors_list = colors # Validate colors in colors_list for j, each_color in enumerate(colors_list): if 'rgb' in each_color: each_color = color_parser( each_color, unlabel_rgb ) for value in each_color: if value > 255.0: raise exceptions.PlotlyError( 'Whoops! The elements in your rgb colors ' 'tuples cannot exceed 255.0.' ) elif '#' in each_color: each_color = color_parser( each_color, hex_to_rgb ) elif isinstance(each_color, tuple): for value in each_color: if value > 1.0: raise exceptions.PlotlyError( 'Whoops! The elements in your colors tuples ' 'cannot exceed 1.0.' ) def convert_colors_to_same_type(colors, colortype='rgb', scale=None, return_default_colors=False, num_of_defualt_colors=2): """ Converts color(s) to the specified color type Takes a single color or an iterable of colors, as well as a list of scale values, and outputs a 2-pair of the list of color(s) converted all to an rgb or tuple color type, aswell as the scale as the second element. If colors is a Plotly Scale name, then 'scale' will be forced to the scale from the respective colorscale and the colors in that colorscale will also be coverted to the selected colortype. If colors is None, then there is an option to return portion of the DEFAULT_PLOTLY_COLORS :param (str|tuple|list) colors: either a plotly scale name, an rgb or hex color, a color tuple or a list/tuple of colors :param (list) scale: see docs for validate_scale_values() :rtype (tuple) (colors_list, scale) if scale is None in the function call, then scale will remain None in the returned tuple """ #if colors_list is None: colors_list = [] if colors is None and return_default_colors is True: colors_list = DEFAULT_PLOTLY_COLORS[0:num_of_defualt_colors] if isinstance(colors, str): if colors in PLOTLY_SCALES: colors_list = colorscale_to_colors(PLOTLY_SCALES[colors]) if scale is None: scale = colorscale_to_scale(PLOTLY_SCALES[colors]) elif 'rgb' in colors or '#' in colors: colors_list = [colors] elif isinstance(colors, tuple): if isinstance(colors[0], Number): colors_list = [colors] else: colors_list = list(colors) elif isinstance(colors, list): colors_list = colors # validate scale if scale is not None: validate_scale_values(scale) if len(colors_list) != len(scale): raise exceptions.PlotlyError( 'Make sure that the length of your scale matches the length ' 'of your list of colors which is {}.'.format(len(colors_list)) ) # convert all colors to rgb for j, each_color in enumerate(colors_list): if '#' in each_color: each_color = color_parser( each_color, hex_to_rgb ) each_color = color_parser( each_color, label_rgb ) colors_list[j] = each_color elif isinstance(each_color, tuple): each_color = color_parser( each_color, convert_to_RGB_255 ) each_color = color_parser( each_color, label_rgb ) colors_list[j] = each_color if colortype == 'rgb': return (colors_list, scale) elif colortype == 'tuple': for j, each_color in enumerate(colors_list): each_color = color_parser( each_color, unlabel_rgb ) each_color = color_parser( each_color, unconvert_from_RGB_255 ) colors_list[j] = each_color return (colors_list, scale) else: raise exceptions.PlotlyError('You must select either rgb or tuple ' 'for your colortype variable.') def convert_dict_colors_to_same_type(colors_dict, colortype='rgb'): """ Converts a colors in a dictioanry of colors to the specified color type :param (dict) colors_dict: a dictioanry whose values are single colors """ for key in colors_dict: if '#' in colors_dict[key]: colors_dict[key] = color_parser( colors_dict[key], hex_to_rgb ) colors_dict[key] = color_parser( colors_dict[key], label_rgb ) elif isinstance(colors_dict[key], tuple): colors_dict[key] = color_parser( colors_dict[key], convert_to_RGB_255 ) colors_dict[key] = color_parser( colors_dict[key], label_rgb ) if colortype == 'rgb': return colors_dict elif colortype == 'tuple': for key in colors_dict: colors_dict[key] = color_parser( colors_dict[key], unlabel_rgb ) colors_dict[key] = color_parser( colors_dict[key], unconvert_from_RGB_255 ) return colors_dict else: raise exceptions.PlotlyError('You must select either rgb or tuple ' 'for your colortype variable.') def validate_scale_values(scale): """ Validates scale values from a colorscale :param (list) scale: a strictly increasing list of floats that begins with 0 and ends with 1. Its usage derives from a colorscale which is a list of two-lists (a list with two elements) of the form [value, color] which are used to determine how interpolation weighting works between the colors in the colorscale. Therefore scale is just the extraction of these values from the two-lists in order """ if len(scale) < 2: raise exceptions.PlotlyError('You must input a list of scale values ' 'that has at least two values.') if (scale[0] != 0) or (scale[-1] != 1): raise exceptions.PlotlyError( 'The first and last number in your scale must be 0.0 and 1.0 ' 'respectively.' ) if not all(x < y for x, y in zip(scale, scale[1:])): raise exceptions.PlotlyError( "'scale' must be a list that contains a strictly increasing " "sequence of numbers." ) def make_colorscale(colors, scale=None): """ Makes a colorscale from a list of colors and a scale Takes a list of colors and scales and constructs a colorscale based on the colors in sequential order. If 'scale' is left empty, a linear- interpolated colorscale will be generated. If 'scale' is a specificed list, it must be the same legnth as colors and must contain all floats For documentation regarding to the form of the output, see https://plot.ly/python/reference/#mesh3d-colorscale :param (list) colors: a list of single colors """ colorscale = [] # validate minimum colors length of 2 if len(colors) < 2: raise exceptions.PlotlyError('You must input a list of colors that ' 'has at least two colors.') if scale is None: scale_incr = 1./(len(colors) - 1) return [[i * scale_incr, color] for i, color in enumerate(colors)] else: if len(colors) != len(scale): raise exceptions.PlotlyError('The length of colors and scale ' 'must be the same.') validate_scale_values(scale) colorscale = [list(tup) for tup in zip(scale, colors)] return colorscale def find_intermediate_color(lowcolor, highcolor, intermed, colortype='tuple'): """ Returns the color at a given distance between two colors This function takes two color tuples, where each element is between 0 and 1, along with a value 0 < intermed < 1 and returns a color that is intermed-percent from lowcolor to highcolor. If colortype is set to 'rgb', the function will automatically convert the rgb type to a tuple, find the intermediate color and return it as an rgb color. """ if colortype == 'rgb': # convert to tuple color, eg. (1, 0.45, 0.7) lowcolor = unlabel_rgb(lowcolor) highcolor = unlabel_rgb(highcolor) diff_0 = float(highcolor[0] - lowcolor[0]) diff_1 = float(highcolor[1] - lowcolor[1]) diff_2 = float(highcolor[2] - lowcolor[2]) inter_med_tuple = ( lowcolor[0] + intermed * diff_0, lowcolor[1] + intermed * diff_1, lowcolor[2] + intermed * diff_2 ) if colortype == 'rgb': # back to an rgb string, e.g. rgb(30, 20, 10) inter_med_rgb = label_rgb(inter_med_tuple) return inter_med_rgb return inter_med_tuple def unconvert_from_RGB_255(colors): """ Return a tuple where each element gets divided by 255 Takes a (list of) color tuple(s) where each element is between 0 and 255. Returns the same tuples where each tuple element is normalized to a value between 0 and 1 """ return (colors[0]/(255.0), colors[1]/(255.0), colors[2]/(255.0)) def convert_to_RGB_255(colors): """ Multiplies each element of a triplet by 255 Each coordinate of the color tuple is rounded to the nearest float and then is turned into an integer. If a number is of the form x.5, then if x is odd, the number rounds up to (x+1). Otherwise, it rounds down to just x. This is the way rounding works in Python 3 and in current statistical analysis to avoid rounding bias :param (list) rgb_components: grabs the three R, G and B values to be returned as computed in the function """ rgb_components = [] for component in colors: rounded_num = decimal.Decimal(str(component*255.0)).quantize( decimal.Decimal('1'), rounding=decimal.ROUND_HALF_EVEN ) # convert rounded number to an integer from 'Decimal' form rounded_num = int(rounded_num) rgb_components.append(rounded_num) return (rgb_components[0], rgb_components[1], rgb_components[2]) def n_colors(lowcolor, highcolor, n_colors, colortype='tuple'): """ Splits a low and high color into a list of n_colors colors in it Accepts two color tuples and returns a list of n_colors colors which form the intermediate colors between lowcolor and highcolor from linearly interpolating through RGB space. If colortype is 'rgb' the function will return a list of colors in the same form. """ if colortype == 'rgb': # convert to tuple lowcolor = unlabel_rgb(lowcolor) highcolor = unlabel_rgb(highcolor) diff_0 = float(highcolor[0] - lowcolor[0]) incr_0 = diff_0/(n_colors - 1) diff_1 = float(highcolor[1] - lowcolor[1]) incr_1 = diff_1/(n_colors - 1) diff_2 = float(highcolor[2] - lowcolor[2]) incr_2 = diff_2/(n_colors - 1) list_of_colors = [] for index in range(n_colors): new_tuple = (lowcolor[0] + (index * incr_0), lowcolor[1] + (index * incr_1), lowcolor[2] + (index * incr_2)) list_of_colors.append(new_tuple) if colortype == 'rgb': # back to an rgb string list_of_colors = color_parser(list_of_colors, label_rgb) return list_of_colors def label_rgb(colors): """ Takes tuple (a, b, c) and returns an rgb color 'rgb(a, b, c)' """ return ('rgb(%s, %s, %s)' % (colors[0], colors[1], colors[2])) def unlabel_rgb(colors): """ Takes rgb color(s) 'rgb(a, b, c)' and returns tuple(s) (a, b, c) This function takes either an 'rgb(a, b, c)' color or a list of such colors and returns the color tuples in tuple(s) (a, b, c) """ str_vals = '' for index in range(len(colors)): try: float(colors[index]) str_vals = str_vals + colors[index] except ValueError: if colors[index] == ',' or colors[index] == '.': str_vals = str_vals + colors[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 = '' return (numbers[0], numbers[1], numbers[2]) def hex_to_rgb(value): """ Calculates rgb values from a hex color code. :param (string) value: Hex color string :rtype (tuple) (r_value, g_value, b_value): tuple of rgb values """ value = value.lstrip('#') hex_total_length = len(value) rgb_section_length = hex_total_length // 3 return tuple(int(value[i:i + rgb_section_length], 16) for i in range(0, hex_total_length, rgb_section_length)) def colorscale_to_colors(colorscale): """ Extracts the colors from colorscale as a list """ color_list = [] for item in colorscale: color_list.append(item[1]) return color_list def colorscale_to_scale(colorscale): """ Extracts the interpolation scale values from colorscale as a list """ scale_list = [] for item in colorscale: scale_list.append(item[0]) return scale_list def convert_colorscale_to_rgb(colorscale): """ Converts the colors in a colorscale to rgb colors A colorscale is an array of arrays, each with a numeric value as the first item and a color as the second. This function specifically is converting a colorscale with tuple colors (each coordinate between 0 and 1) into a colorscale with the colors transformed into rgb colors """ for color in colorscale: color[1] = convert_to_RGB_255(color[1]) for color in colorscale: color[1] = label_rgb(color[1]) return colorscale plotly-2.2.3+dfsg.orig/plotly/utils.py0000644000175000017500000003605513104403274017313 0ustar noahfxnoahfx""" utils ===== Low-level functionality NOT intended for users to EVER use. """ from __future__ import absolute_import import os.path import re import sys import threading import decimal from collections import deque import pytz from decorator import decorator from requests.compat import json as _json from plotly.optional_imports import get_module from . exceptions import PlotlyError # Optional imports, may be None for users that only use our core functionality. numpy = get_module('numpy') pandas = get_module('pandas') sage_all = get_module('sage.all') ### incase people are using threading, we lock file reads lock = threading.Lock() ### general file setup tools ### def load_json_dict(filename, *args): """Checks if file exists. Returns {} if something fails.""" data = {} if os.path.exists(filename): lock.acquire() with open(filename, "r") as f: try: data = _json.load(f) if not isinstance(data, dict): data = {} except: data = {} # TODO: issue a warning and bubble it up lock.release() if args: return {key: data[key] for key in args if key in data} return data def save_json_dict(filename, json_dict): """Save json to file. Error if path DNE, not a dict, or invalid json.""" if isinstance(json_dict, dict): # this will raise a TypeError if something goes wrong json_string = _json.dumps(json_dict, indent=4) lock.acquire() with open(filename, "w") as f: f.write(json_string) lock.release() else: raise TypeError("json_dict was not a dictionary. not saving.") def ensure_file_exists(filename): """Given a valid filename, make sure it exists (will create if DNE).""" if not os.path.exists(filename): head, tail = os.path.split(filename) ensure_dir_exists(head) with open(filename, 'w') as f: pass # just create the file def ensure_dir_exists(directory): """Given a valid directory path, make sure it exists.""" if dir: if not os.path.isdir(directory): os.makedirs(directory) def iso_to_plotly_time_string(iso_string): """Remove timezone info and replace 'T' delimeter with ' ' (ws).""" # make sure we don't send timezone info to plotly if (iso_string.split('-')[:3] is '00:00') or\ (iso_string.split('+')[0] is '00:00'): raise Exception("Plotly won't accept timestrings with timezone info.\n" "All timestrings are assumed to be in UTC.") iso_string = iso_string.replace('-00:00', '').replace('+00:00', '') if iso_string.endswith('T00:00:00'): return iso_string.replace('T00:00:00', '') else: return iso_string.replace('T', ' ') ### Custom JSON encoders ### class NotEncodable(Exception): pass class PlotlyJSONEncoder(_json.JSONEncoder): """ Meant to be passed as the `cls` kwarg to json.dumps(obj, cls=..) See PlotlyJSONEncoder.default for more implementation information. Additionally, this encoder overrides nan functionality so that 'Inf', 'NaN' and '-Inf' encode to 'null'. Which is stricter JSON than the Python version. """ def coerce_to_strict(self, const): """ This is used to ultimately *encode* into strict JSON, see `encode` """ # before python 2.7, 'true', 'false', 'null', were include here. if const in ('Infinity', '-Infinity', 'NaN'): return None else: return const def encode(self, o): """ Load and then dump the result using parse_constant kwarg Note that setting invalid separators will cause a failure at this step. """ # this will raise errors in a normal-expected way encoded_o = super(PlotlyJSONEncoder, self).encode(o) # now: # 1. `loads` to switch Infinity, -Infinity, NaN to None # 2. `dumps` again so you get 'null' instead of extended JSON try: new_o = _json.loads(encoded_o, parse_constant=self.coerce_to_strict) except ValueError: # invalid separators will fail here. raise a helpful exception raise ValueError( "Encoding into strict JSON failed. Did you set the separators " "valid JSON separators?" ) else: return _json.dumps(new_o, sort_keys=self.sort_keys, indent=self.indent, separators=(self.item_separator, self.key_separator)) def default(self, obj): """ Accept an object (of unknown type) and try to encode with priority: 1. builtin: user-defined objects 2. sage: sage math cloud 3. pandas: dataframes/series 4. numpy: ndarrays 5. datetime: time/datetime objects Each method throws a NotEncoded exception if it fails. The default method will only get hit if the object is not a type that is naturally encoded by json: Normal objects: dict object list, tuple array str, unicode string int, long, float number True true False false None null Extended objects: float('nan') 'NaN' float('infinity') 'Infinity' float('-infinity') '-Infinity' Therefore, we only anticipate either unknown iterables or values here. """ # TODO: The ordering if these methods is *very* important. Is this OK? encoding_methods = ( self.encode_as_plotly, self.encode_as_sage, self.encode_as_numpy, self.encode_as_pandas, self.encode_as_datetime, self.encode_as_date, self.encode_as_list, # because some values have `tolist` do last. self.encode_as_decimal ) for encoding_method in encoding_methods: try: return encoding_method(obj) except NotEncodable: pass return _json.JSONEncoder.default(self, obj) @staticmethod def encode_as_plotly(obj): """Attempt to use a builtin `to_plotly_json` method.""" try: return obj.to_plotly_json() except AttributeError: raise NotEncodable @staticmethod def encode_as_list(obj): """Attempt to use `tolist` method to convert to normal Python list.""" if hasattr(obj, 'tolist'): return obj.tolist() else: raise NotEncodable @staticmethod def encode_as_sage(obj): """Attempt to convert sage.all.RR to floats and sage.all.ZZ to ints""" if not sage_all: raise NotEncodable if obj in sage_all.RR: return float(obj) elif obj in sage_all.ZZ: return int(obj) else: raise NotEncodable @staticmethod def encode_as_pandas(obj): """Attempt to convert pandas.NaT""" if not pandas: raise NotEncodable if obj is pandas.NaT: return None else: raise NotEncodable @staticmethod def encode_as_numpy(obj): """Attempt to convert numpy.ma.core.masked""" if not numpy: raise NotEncodable if obj is numpy.ma.core.masked: return float('nan') else: raise NotEncodable @staticmethod def encode_as_datetime(obj): """Attempt to convert to utc-iso time string using datetime methods.""" # first we need to get this into utc try: obj = obj.astimezone(pytz.utc) except ValueError: # we'll get a value error if trying to convert with naive datetime pass except TypeError: # pandas throws a typeerror here instead of a value error, it's OK pass except AttributeError: # we'll get an attribute error if astimezone DNE raise NotEncodable # now we need to get a nicely formatted time string try: time_string = obj.isoformat() except AttributeError: raise NotEncodable else: return iso_to_plotly_time_string(time_string) @staticmethod def encode_as_date(obj): """Attempt to convert to utc-iso time string using date methods.""" try: time_string = obj.isoformat() except AttributeError: raise NotEncodable else: return iso_to_plotly_time_string(time_string) @staticmethod def encode_as_decimal(obj): """Attempt to encode decimal by converting it to float""" if isinstance(obj, decimal.Decimal): return float(obj) else: raise NotEncodable ### unicode stuff ### def decode_unicode(coll): if isinstance(coll, list): for no, entry in enumerate(coll): if isinstance(entry, (dict, list)): coll[no] = decode_unicode(entry) else: if isinstance(entry, str): try: coll[no] = str(entry) except UnicodeEncodeError: pass elif isinstance(coll, dict): keys, vals = list(coll.keys()), list(coll.values()) for key, val in zip(keys, vals): if isinstance(val, (dict, list)): coll[key] = decode_unicode(val) elif isinstance(val, str): try: coll[key] = str(val) except UnicodeEncodeError: pass coll[str(key)] = coll.pop(key) return coll ### docstring templating ### def template_doc(**names): def _decorator(func): if sys.version[:3] != '3.2': if func.__doc__ is not None: func.__doc__ = func.__doc__.format(**names) return func return _decorator def get_first_duplicate(items): seen = set() for item in items: if item not in seen: seen.add(item) else: return item return None ### source key def is_source_key(key): src_regex = re.compile(r'.+src$') if src_regex.match(key) is not None: return True else: return False def node_generator(node, path=()): """ General, node-yielding generator. Yields (node, path) tuples when it finds values that are dict instances. A path is a sequence of hashable values that can be used as either keys to a mapping (dict) or indices to a sequence (list). A path is always wrt to some object. Given an object, a path explains how to get from the top level of that object to a nested value in the object. :param (dict) node: Part of a dict to be traversed. :param (tuple[str]) path: Defines the path of the current node. :return: (Generator) Example: >>> for node, path in node_generator({'a': {'b': 5}}): >>> print node, path {'a': {'b': 5}} () {'b': 5} ('a', ) """ if not isinstance(node, dict): return # in case it's called with a non-dict node at top level yield node, path for key, val in node.items(): if isinstance(val, dict): for item in node_generator(val, path + (key, )): yield item def get_by_path(obj, path): """ Iteratively get on obj for each key in path. :param (list|dict) obj: The top-level object. :param (tuple[str]|tuple[int]) path: Keys to access parts of obj. :return: (*) Example: >>> figure = {'data': [{'x': [5]}]} >>> path = ('data', 0, 'x') >>> get_by_path(figure, path) # [5] """ for key in path: obj = obj[key] return obj ### validation def validate_world_readable_and_sharing_settings(option_set): if ('world_readable' in option_set and option_set['world_readable'] is True and 'sharing' in option_set and option_set['sharing'] is not None and option_set['sharing'] != 'public'): raise PlotlyError( "Looks like you are setting your plot privacy to both " "public and private.\n If you set world_readable as True, " "sharing can only be set to 'public'") elif ('world_readable' in option_set and option_set['world_readable'] is False and 'sharing' in option_set and option_set['sharing'] == 'public'): raise PlotlyError( "Looks like you are setting your plot privacy to both " "public and private.\n If you set world_readable as " "False, sharing can only be set to 'private' or 'secret'") elif ('sharing' in option_set and option_set['sharing'] not in ['public', 'private', 'secret', None]): raise PlotlyError( "The 'sharing' argument only accepts one of the following " "strings:\n'public' -- for public plots\n" "'private' -- for private plots\n" "'secret' -- for private plots that can be shared with a " "secret url" ) def set_sharing_and_world_readable(option_set): if 'world_readable' in option_set and 'sharing' not in option_set: option_set['sharing'] = ( 'public' if option_set['world_readable'] else 'private') elif 'sharing' in option_set and 'world_readable' not in option_set: if option_set['sharing'] == 'public': option_set['world_readable'] = True else: option_set['world_readable'] = False def _default_memoize_key_function(*args, **kwargs): """Factored out in case we want to allow callers to specify this func.""" if kwargs: # frozenset is used to ensure hashability return args, frozenset(kwargs.items()) else: return args def memoize(maxsize=128): """ Memoize a function by its arguments. Note, if the wrapped function returns a mutable result, the caller is responsible for *not* mutating the result as it will mutate the cache itself. :param (int|None) maxsize: Limit the number of cached results. This is a simple way to prevent memory leaks. Setting this to `None` will remember *all* calls. The 128 number is used for parity with the Python 3.2 `functools.lru_cache` tool. """ keys = deque() cache = {} def _memoize(*all_args, **kwargs): func = all_args[0] args = all_args[1:] key = _default_memoize_key_function(*args, **kwargs) if key in keys: return cache[key] if maxsize is not None and len(keys) == maxsize: cache.pop(keys.pop()) result = func(*args, **kwargs) keys.appendleft(key) cache[key] = result return result return decorator(_memoize) plotly-2.2.3+dfsg.orig/plotly/exceptions.py0000644000175000017500000001264013136102462020326 0ustar noahfxnoahfx""" exceptions ========== A module that contains plotly's exception hierarchy. """ from __future__ import absolute_import from plotly.api.utils import to_native_utf8_string # Base Plotly Error class PlotlyError(Exception): pass class InputError(PlotlyError): pass class PlotlyRequestError(PlotlyError): """General API error. Raised for *all* failed requests.""" def __init__(self, message, status_code, content): self.message = to_native_utf8_string(message) self.status_code = status_code self.content = content def __str__(self): return self.message # Grid Errors COLUMN_NOT_YET_UPLOADED_MESSAGE = ( "Hm... it looks like your column '{column_name}' hasn't " "been uploaded to Plotly yet. You need to upload your " "column to Plotly before you can assign it to '{reference}'.\n" "To upload, try `plotly.plotly.grid_objs.upload` or " "`plotly.plotly.grid_objs.append_column`.\n" "Questions? chris@plot.ly" ) NON_UNIQUE_COLUMN_MESSAGE = ( "Yikes, plotly grids currently " "can't have duplicate column names. Rename " "the column \"{0}\" and try again." ) class PlotlyEmptyDataError(PlotlyError): pass # Graph Objects Errors class PlotlyGraphObjectError(PlotlyError): def __init__(self, message='', path=(), notes=()): """ General graph object error for validation failures. :param (str|unicode) message: The error message. :param (iterable) path: A path pointing to the error. :param notes: Add additional notes, but keep default exception message. """ self.message = message self.plain_message = message # for backwards compat self.path = list(path) self.notes = notes super(PlotlyGraphObjectError, self).__init__(message) def __str__(self): """This is called by Python to present the error message.""" format_dict = { 'message': self.message, 'path': '[' + ']['.join(repr(k) for k in self.path) + ']', 'notes': '\n'.join(self.notes) } return ('{message}\n\nPath To Error: {path}\n\n{notes}' .format(**format_dict)) class PlotlyDictKeyError(PlotlyGraphObjectError): def __init__(self, obj, path, notes=()): """See PlotlyGraphObjectError.__init__ for param docs.""" format_dict = {'attribute': path[-1], 'object_name': obj._name} message = ("'{attribute}' is not allowed in '{object_name}'" .format(**format_dict)) notes = [obj.help(return_help=True)] + list(notes) super(PlotlyDictKeyError, self).__init__( message=message, path=path, notes=notes ) class PlotlyDictValueError(PlotlyGraphObjectError): def __init__(self, obj, path, notes=()): """See PlotlyGraphObjectError.__init__ for param docs.""" format_dict = {'attribute': path[-1], 'object_name': obj._name} message = ("'{attribute}' has invalid value inside '{object_name}'" .format(**format_dict)) notes = [obj.help(path[-1], return_help=True)] + list(notes) super(PlotlyDictValueError, self).__init__( message=message, notes=notes, path=path ) class PlotlyListEntryError(PlotlyGraphObjectError): def __init__(self, obj, path, notes=()): """See PlotlyGraphObjectError.__init__ for param docs.""" format_dict = {'index': path[-1], 'object_name': obj._name} message = ("Invalid entry found in '{object_name}' at index, '{index}'" .format(**format_dict)) notes = [obj.help(return_help=True)] + list(notes) super(PlotlyListEntryError, self).__init__( message=message, path=path, notes=notes ) class PlotlyDataTypeError(PlotlyGraphObjectError): def __init__(self, obj, path, notes=()): """See PlotlyGraphObjectError.__init__ for param docs.""" format_dict = {'index': path[-1], 'object_name': obj._name} message = ("Invalid entry found in '{object_name}' at index, '{index}'" .format(**format_dict)) note = "It's invalid because it doesn't contain a valid 'type' value." notes = [note] + list(notes) super(PlotlyDataTypeError, self).__init__( message=message, path=path, notes=notes ) # Local Config Errors class PlotlyLocalError(PlotlyError): pass class PlotlyLocalCredentialsError(PlotlyLocalError): def __init__(self): message = ( "\n" "Couldn't find a 'username', 'api-key' pair for you on your local " "machine. To sign in temporarily (until you stop running Python), " "run:\n" ">>> import plotly.plotly as py\n" ">>> py.sign_in('username', 'api_key')\n\n" "Even better, save your credentials permanently using the 'tools' " "module:\n" ">>> import plotly.tools as tls\n" ">>> tls.set_credentials_file(username='username', " "api_key='api-key')\n\n" "For more help, see https://plot.ly/python.\n" ) super(PlotlyLocalCredentialsError, self).__init__(message) # Server Errors class PlotlyServerError(PlotlyError): pass class PlotlyConnectionError(PlotlyServerError): pass class PlotlyCredentialError(PlotlyServerError): pass class PlotlyAccountError(PlotlyServerError): pass class PlotlyRateLimitError(PlotlyServerError): pass plotly-2.2.3+dfsg.orig/plotly/plotly/0000755000175000017500000000000013211605515017114 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/plotly/plotly.py0000644000175000017500000020353313174436015021024 0ustar noahfxnoahfx""" plotly ====== A module that contains the plotly class, a liaison between the user and ploty's servers. 1. get DEFAULT_PLOT_OPTIONS for options 2. update plot_options with .plotly/ dir 3. update plot_options with _plot_options 4. update plot_options with kwargs! """ from __future__ import absolute_import import copy import json import os import time import warnings import webbrowser import six import six.moves from requests.compat import json as _json from plotly import exceptions, files, session, tools, utils from plotly.api import v1, v2 from plotly.plotly import chunked_requests from plotly.grid_objs import Grid, Column from plotly.dashboard_objs import dashboard_objs as dashboard # This is imported like this for backwards compat. Careful if changing. from plotly.config import get_config, get_credentials __all__ = None DEFAULT_PLOT_OPTIONS = { 'filename': "plot from API", 'fileopt': "new", 'world_readable': files.FILE_CONTENT[files.CONFIG_FILE]['world_readable'], 'auto_open': files.FILE_CONTENT[files.CONFIG_FILE]['auto_open'], 'validate': True, 'sharing': files.FILE_CONTENT[files.CONFIG_FILE]['sharing'] } SHARING_ERROR_MSG = ( "Whoops, sharing can only be set to either 'public', 'private', or " "'secret'." ) # test file permissions and make sure nothing is corrupted tools.ensure_local_plotly_files() # don't break backwards compatibility def sign_in(username, api_key, **kwargs): session.sign_in(username, api_key, **kwargs) try: # The only way this can succeed is if the user can be authenticated # with the given, username, api_key, and plotly_api_domain. v2.users.current() except exceptions.PlotlyRequestError: raise exceptions.PlotlyError('Sign in failed.') update_plot_options = session.update_session_plot_options def _plot_option_logic(plot_options_from_call_signature): """ Given some plot_options as part of a plot call, decide on final options. Precedence: 1 - Start with DEFAULT_PLOT_OPTIONS 2 - Update each key with ~/.plotly/.config options (tls.get_config) 3 - Update each key with session plot options (set by py.sign_in) 4 - Update each key with plot, iplot call signature options """ default_plot_options = copy.deepcopy(DEFAULT_PLOT_OPTIONS) file_options = tools.get_config_file() session_options = session.get_session_plot_options() plot_options_from_call_signature = copy.deepcopy(plot_options_from_call_signature) # Validate options and fill in defaults w world_readable and sharing for option_set in [plot_options_from_call_signature, session_options, file_options]: utils.validate_world_readable_and_sharing_settings(option_set) utils.set_sharing_and_world_readable(option_set) # dynamic defaults if ('filename' in option_set and 'fileopt' not in option_set): option_set['fileopt'] = 'overwrite' user_plot_options = {} user_plot_options.update(default_plot_options) user_plot_options.update(file_options) user_plot_options.update(session_options) user_plot_options.update(plot_options_from_call_signature) user_plot_options = {k: v for k, v in user_plot_options.items() if k in default_plot_options} return user_plot_options def iplot(figure_or_data, **plot_options): """Create a unique url for this plot in Plotly and open in IPython. plot_options keyword agruments: filename (string) -- the name that will be associated with this figure fileopt ('new' | 'overwrite' | 'extend' | 'append') - 'new': create a new, unique url for this plot - 'overwrite': overwrite the file associated with `filename` with this - 'extend': add additional numbers (data) to existing traces - 'append': add additional traces to existing data lists sharing ('public' | 'private' | 'secret') -- Toggle who can view this graph - 'public': Anyone can view this graph. It will appear in your profile and can appear in search engines. You do not need to be logged in to Plotly to view this chart. - 'private': Only you can view this plot. It will not appear in the Plotly feed, your profile, or search engines. You must be logged in to Plotly to view this graph. You can privately share this graph with other Plotly users in your online Plotly account and they will need to be logged in to view this plot. - 'secret': Anyone with this secret link can view this chart. It will not appear in the Plotly feed, your profile, or search engines. If it is embedded inside a webpage or an IPython notebook, anybody who is viewing that page will be able to view the graph. You do not need to be logged in to view this plot. world_readable (default=True) -- Deprecated: use "sharing". Make this figure private/public """ if 'auto_open' not in plot_options: plot_options['auto_open'] = False url = plot(figure_or_data, **plot_options) if isinstance(figure_or_data, dict): layout = figure_or_data.get('layout', {}) else: layout = {} embed_options = dict() embed_options['width'] = layout.get('width', '100%') embed_options['height'] = layout.get('height', 525) try: float(embed_options['width']) except (ValueError, TypeError): pass else: embed_options['width'] = str(embed_options['width']) + 'px' try: float(embed_options['height']) except (ValueError, TypeError): pass else: embed_options['height'] = str(embed_options['height']) + 'px' return tools.embed(url, **embed_options) def plot(figure_or_data, validate=True, **plot_options): """Create a unique url for this plot in Plotly and optionally open url. plot_options keyword agruments: filename (string) -- the name that will be associated with this figure fileopt ('new' | 'overwrite' | 'extend' | 'append') -- 'new' creates a 'new': create a new, unique url for this plot 'overwrite': overwrite the file associated with `filename` with this 'extend': add additional numbers (data) to existing traces 'append': add additional traces to existing data lists auto_open (default=True) -- Toggle browser options True: open this plot in a new browser tab False: do not open plot in the browser, but do return the unique url sharing ('public' | 'private' | 'secret') -- Toggle who can view this graph - 'public': Anyone can view this graph. It will appear in your profile and can appear in search engines. You do not need to be logged in to Plotly to view this chart. - 'private': Only you can view this plot. It will not appear in the Plotly feed, your profile, or search engines. You must be logged in to Plotly to view this graph. You can privately share this graph with other Plotly users in your online Plotly account and they will need to be logged in to view this plot. - 'secret': Anyone with this secret link can view this chart. It will not appear in the Plotly feed, your profile, or search engines. If it is embedded inside a webpage or an IPython notebook, anybody who is viewing that page will be able to view the graph. You do not need to be logged in to view this plot. world_readable (default=True) -- Deprecated: use "sharing". Make this figure private/public """ figure = tools.return_figure_from_figure_or_data(figure_or_data, validate) for entry in figure['data']: if ('type' in entry) and (entry['type'] == 'scattergl'): continue for key, val in list(entry.items()): try: if len(val) > 40000: msg = ("Woah there! Look at all those points! Due to " "browser limitations, the Plotly SVG drawing " "functions have a hard time " "graphing more than 500k data points for line " "charts, or 40k points for other types of charts. " "Here are some suggestions:\n" "(1) Use the `plotly.graph_objs.Scattergl` " "trace object to generate a WebGl graph.\n" "(2) Trying using the image API to return an image " "instead of a graph URL\n" "(3) Use matplotlib\n" "(4) See if you can create your visualization with " "fewer data points\n\n" "If the visualization you're using aggregates " "points (e.g., box plot, histogram, etc.) you can " "disregard this warning.") warnings.warn(msg) except TypeError: pass plot_options = _plot_option_logic(plot_options) fig = tools._replace_newline(figure) # does not mutate figure data = fig.get('data', []) plot_options['layout'] = fig.get('layout', {}) response = v1.clientresp(data, **plot_options) # Check if the url needs a secret key url = response.json()['url'] if plot_options['sharing'] == 'secret': if 'share_key=' not in url: # add_share_key_to_url updates the url to include the share_key url = add_share_key_to_url(url) if plot_options['auto_open']: _open_url(url) return url def iplot_mpl(fig, resize=True, strip_style=False, update=None, **plot_options): """Replot a matplotlib figure with plotly in IPython. This function: 1. converts the mpl figure into JSON (run help(plolty.tools.mpl_to_plotly)) 2. makes a request to Plotly to save this figure in your account 3. displays the image in your IPython output cell Positional agruments: fig -- a figure object from matplotlib Keyword arguments: resize (default=True) -- allow plotly to choose the figure size strip_style (default=False) -- allow plotly to choose style options update (default=None) -- update the resulting figure with an 'update' dictionary-like object resembling a plotly 'Figure' object Additional keyword arguments: plot_options -- run help(plotly.plotly.iplot) """ fig = tools.mpl_to_plotly(fig, resize=resize, strip_style=strip_style) if update and isinstance(update, dict): fig.update(update) fig.validate() elif update is not None: raise exceptions.PlotlyGraphObjectError( "'update' must be dictionary-like and a valid plotly Figure " "object. Run 'help(plotly.graph_objs.Figure)' for more info." ) return iplot(fig, **plot_options) def plot_mpl(fig, resize=True, strip_style=False, update=None, **plot_options): """Replot a matplotlib figure with plotly. This function: 1. converts the mpl figure into JSON (run help(plolty.tools.mpl_to_plotly)) 2. makes a request to Plotly to save this figure in your account 3. opens your figure in a browser tab OR returns the unique figure url Positional agruments: fig -- a figure object from matplotlib Keyword arguments: resize (default=True) -- allow plotly to choose the figure size strip_style (default=False) -- allow plotly to choose style options update (default=None) -- update the resulting figure with an 'update' dictionary-like object resembling a plotly 'Figure' object Additional keyword arguments: plot_options -- run help(plotly.plotly.plot) """ fig = tools.mpl_to_plotly(fig, resize=resize, strip_style=strip_style) if update and isinstance(update, dict): fig.update(update) fig.validate() elif update is not None: raise exceptions.PlotlyGraphObjectError( "'update' must be dictionary-like and a valid plotly Figure " "object. Run 'help(plotly.graph_objs.Figure)' for more info." ) return plot(fig, **plot_options) def _swap_keys(obj, key1, key2): """Swap obj[key1] with obj[key2]""" val1, val2 = None, None try: val2 = obj.pop(key1) except KeyError: pass try: val1 = obj.pop(key2) except KeyError: pass if val2 is not None: obj[key2] = val2 if val1 is not None: obj[key1] = val1 def _swap_xy_data(data_obj): """Swap x and y data and references""" swaps = [('x', 'y'), ('x0', 'y0'), ('dx', 'dy'), ('xbins', 'ybins'), ('nbinsx', 'nbinsy'), ('autobinx', 'autobiny'), ('error_x', 'error_y')] for swap in swaps: _swap_keys(data_obj, swap[0], swap[1]) try: rows = len(data_obj['z']) cols = len(data_obj['z'][0]) for row in data_obj['z']: if len(row) != cols: raise TypeError # if we can't do transpose, we hit an exception before here z = data_obj.pop('z') data_obj['z'] = [[0 for rrr in range(rows)] for ccc in range(cols)] for iii in range(rows): for jjj in range(cols): data_obj['z'][jjj][iii] = z[iii][jjj] except (KeyError, TypeError, IndexError) as err: warn = False try: if data_obj['z'] is not None: warn = True if len(data_obj['z']) == 0: warn = False except (KeyError, TypeError): pass if warn: warnings.warn( "Data in this file required an 'xy' swap but the 'z' matrix " "in one of the data objects could not be transposed. Here's " "why:\n\n{}".format(repr(err)) ) def get_figure(file_owner_or_url, file_id=None, raw=False): """Returns a JSON figure representation for the specified file Plotly uniquely identifies figures with a 'file_owner'/'file_id' pair. Since each file is given a corresponding unique url, you may also simply pass a valid plotly url as the first argument. Examples: fig = get_figure('https://plot.ly/~chris/1638') fig = get_figure('chris', 1638) Note, if you're using a file_owner string as the first argument, you MUST specify a `file_id` keyword argument. Else, if you're using a url string as the first argument, you MUST NOT specify a `file_id` keyword argument, or file_id must be set to Python's None value. Positional arguments: file_owner_or_url (string) -- a valid plotly username OR a valid plotly url Keyword arguments: file_id (default=None) -- an int or string that can be converted to int if you're using a url, don't fill this in! raw (default=False) -- if true, return unicode JSON string verbatim** **by default, plotly will return a Figure object (run help(plotly .graph_objs.Figure)). This representation decodes the keys and values from unicode (if possible), removes information irrelevant to the figure representation, and converts the JSON dictionary objects to plotly `graph objects`. """ plotly_rest_url = get_config()['plotly_domain'] if file_id is None: # assume we're using a url url = file_owner_or_url if url[:len(plotly_rest_url)] != plotly_rest_url: raise exceptions.PlotlyError( "Because you didn't supply a 'file_id' in the call, " "we're assuming you're trying to snag a figure from a url. " "You supplied the url, '{0}', we expected it to start with " "'{1}'." "\nRun help on this function for more information." "".format(url, plotly_rest_url)) head = plotly_rest_url + "/~" file_owner = url.replace(head, "").split('/')[0] file_id = url.replace(head, "").split('/')[1] else: file_owner = file_owner_or_url try: int(file_id) except ValueError: raise exceptions.PlotlyError( "The 'file_id' argument was not able to be converted into an " "integer number. Make sure that the positional 'file_id' argument " "is a number that can be converted into an integer or a string " "that can be converted into an integer." ) if int(file_id) < 0: raise exceptions.PlotlyError( "The 'file_id' argument must be a non-negative number." ) fid = '{}:{}'.format(file_owner, file_id) response = v2.plots.content(fid, inline_data=True) figure = response.json() # Fix 'histogramx', 'histogramy', and 'bardir' stuff for index, entry in enumerate(figure['data']): try: # Use xbins to bin data in x, and ybins to bin data in y if all((entry['type'] == 'histogramy', 'xbins' in entry, 'ybins' not in entry)): entry['ybins'] = entry.pop('xbins') # Convert bardir to orientation, and put the data into the axes # it's eventually going to be used with if entry['type'] in ['histogramx', 'histogramy']: entry['type'] = 'histogram' if 'bardir' in entry: entry['orientation'] = entry.pop('bardir') if entry['type'] == 'bar': if entry['orientation'] == 'h': _swap_xy_data(entry) if entry['type'] == 'histogram': if ('x' in entry) and ('y' not in entry): if entry['orientation'] == 'h': _swap_xy_data(entry) del entry['orientation'] if ('y' in entry) and ('x' not in entry): if entry['orientation'] == 'v': _swap_xy_data(entry) del entry['orientation'] figure['data'][index] = entry except KeyError: pass # Remove stream dictionary if found in a data trace # (it has private tokens in there we need to hide!) for index, entry in enumerate(figure['data']): if 'stream' in entry: del figure['data'][index]['stream'] if raw: return figure return tools.get_valid_graph_obj(figure, obj_type='Figure') @utils.template_doc(**tools.get_config_file()) class Stream: """ Interface to Plotly's real-time graphing API. Initialize a Stream object with a stream_id found in {plotly_domain}/settings. Real-time graphs are initialized with a call to `plot` that embeds your unique `stream_id`s in each of the graph's traces. The `Stream` interface plots data to these traces, as identified with the unique stream_id, in real-time. Every viewer of the graph sees the same data at the same time. View examples and tutorials here: https://plot.ly/python/streaming/ Stream example: # Initialize a streaming graph # by embedding stream_id's in the graph's traces import plotly.plotly as py from plotly.graph_objs import Data, Scatter, Stream stream_id = "your_stream_id" # See {plotly_domain}/settings py.plot(Data([Scatter(x=[], y=[], stream=Stream(token=stream_id, maxpoints=100))])) # Stream data to the import trace stream = Stream(stream_id) # Initialize a stream object stream.open() # Open the stream stream.write(dict(x=1, y=1)) # Plot (1, 1) in your graph """ HTTP_PORT = 80 HTTPS_PORT = 443 @utils.template_doc(**tools.get_config_file()) def __init__(self, stream_id): """ Initialize a Stream object with your unique stream_id. Find your stream_id at {plotly_domain}/settings. For more help, see: `help(plotly.plotly.Stream)` or see examples and tutorials here: https://plot.ly/python/streaming/ """ self.stream_id = stream_id self._stream = None def get_streaming_specs(self): """ Returns the streaming server, port, ssl_enabled flag, and headers. """ streaming_url = get_config()['plotly_streaming_domain'] ssl_verification_enabled = get_config()['plotly_ssl_verification'] ssl_enabled = 'https' in streaming_url port = self.HTTPS_PORT if ssl_enabled else self.HTTP_PORT # If no scheme (https/https) is included in the streaming_url, the # host will be None. Use streaming_url in this case. host = (six.moves.urllib.parse.urlparse(streaming_url).hostname or streaming_url) headers = {'Host': host, 'plotly-streamtoken': self.stream_id} streaming_specs = { 'server': host, 'port': port, 'ssl_enabled': ssl_enabled, 'ssl_verification_enabled': ssl_verification_enabled, 'headers': headers } return streaming_specs def heartbeat(self, reconnect_on=(200, '', 408)): """ Keep stream alive. Streams will close after ~1 min of inactivity. If the interval between stream writes is > 30 seconds, you should consider adding a heartbeat between your stream.write() calls like so: >>> stream.heartbeat() """ try: self._stream.write('\n', reconnect_on=reconnect_on) except AttributeError: raise exceptions.PlotlyError( "Stream has not been opened yet, " "cannot write to a closed connection. " "Call `open()` on the stream to open the stream." ) @property def connected(self): if self._stream is None: return False return self._stream._isconnected() def open(self): """ Open streaming connection to plotly. For more help, see: `help(plotly.plotly.Stream)` or see examples and tutorials here: https://plot.ly/python/streaming/ """ streaming_specs = self.get_streaming_specs() self._stream = chunked_requests.Stream(**streaming_specs) def write(self, trace, layout=None, validate=True, reconnect_on=(200, '', 408)): """ Write to an open stream. Once you've instantiated a 'Stream' object with a 'stream_id', you can 'write' to it in real time. positional arguments: trace - A valid plotly trace object (e.g., Scatter, Heatmap, etc.). Not all keys in these are `stremable` run help(Obj) on the type of trace your trying to stream, for each valid key, if the key is streamable, it will say 'streamable = True'. Trace objects must be dictionary-like. keyword arguments: layout (default=None) - A valid Layout object Run help(plotly.graph_objs.Layout) validate (default = True) - Validate this stream before sending? This will catch local errors if set to True. Some valid keys for trace dictionaries: 'x', 'y', 'text', 'z', 'marker', 'line' Examples: >>> write(dict(x=1, y=2)) # assumes 'scatter' type >>> write(Bar(x=[1, 2, 3], y=[10, 20, 30])) >>> write(Scatter(x=1, y=2, text='scatter text')) >>> write(Scatter(x=1, y=3, marker=Marker(color='blue'))) >>> write(Heatmap(z=[[1, 2, 3], [4, 5, 6]])) The connection to plotly's servers is checked before writing and reconnected if disconnected and if the response status code is in `reconnect_on`. For more help, see: `help(plotly.plotly.Stream)` or see examples and tutorials here: http://nbviewer.ipython.org/github/plotly/python-user-guide/blob/master/s7_streaming/s7_streaming.ipynb """ stream_object = dict() stream_object.update(trace) if 'type' not in stream_object: stream_object['type'] = 'scatter' if validate: try: tools.validate(stream_object, stream_object['type']) except exceptions.PlotlyError as err: raise exceptions.PlotlyError( "Part of the data object with type, '{0}', is invalid. " "This will default to 'scatter' if you do not supply a " "'type'. If you do not want to validate your data objects " "when streaming, you can set 'validate=False' in the call " "to 'your_stream.write()'. Here's why the object is " "invalid:\n\n{1}".format(stream_object['type'], err) ) if layout is not None: try: tools.validate(layout, 'Layout') except exceptions.PlotlyError as err: raise exceptions.PlotlyError( "Your layout kwarg was invalid. " "Here's why:\n\n{0}".format(err) ) del stream_object['type'] if layout is not None: stream_object.update(dict(layout=layout)) # TODO: allow string version of this? jdata = _json.dumps(stream_object, cls=utils.PlotlyJSONEncoder) jdata += "\n" try: self._stream.write(jdata, reconnect_on=reconnect_on) except AttributeError: raise exceptions.PlotlyError( "Stream has not been opened yet, " "cannot write to a closed connection. " "Call `open()` on the stream to open the stream.") def close(self): """ Close the stream connection to plotly's streaming servers. For more help, see: `help(plotly.plotly.Stream)` or see examples and tutorials here: https://plot.ly/python/streaming/ """ try: self._stream.close() except AttributeError: raise exceptions.PlotlyError("Stream has not been opened yet.") class image: """ Helper functions wrapped around plotly's static image generation api. """ @staticmethod def get(figure_or_data, format='png', width=None, height=None, scale=None): """Return a static image of the plot described by `figure_or_data`. positional arguments: - figure_or_data: The figure dict-like or data list-like object that describes a plotly figure. Same argument used in `py.plot`, `py.iplot`, see https://plot.ly/python for examples - format: 'png', 'svg', 'jpeg', 'pdf' - width: output width - height: output height - scale: Increase the resolution of the image by `scale` amount (e.g. `3`) Only valid for PNG and JPEG images. example: ``` import plotly.plotly as py fig = {'data': [{'x': [1, 2, 3], 'y': [3, 1, 5], 'type': 'bar'}]} py.image.get(fig, 'png', scale=3) ``` """ # TODO: format is a built-in name... we shouldn't really use it if isinstance(figure_or_data, dict): figure = figure_or_data elif isinstance(figure_or_data, list): figure = {'data': figure_or_data} else: raise exceptions.PlotlyEmptyDataError( "`figure_or_data` must be a dict or a list." ) if format not in ['png', 'svg', 'jpeg', 'pdf']: raise exceptions.PlotlyError( "Invalid format. This version of your Plotly-Python " "package currently only supports png, svg, jpeg, and pdf. " "Learn more about image exporting, and the currently " "supported file types here: " "https://plot.ly/python/static-image-export/" ) if scale is not None: try: scale = float(scale) except: raise exceptions.PlotlyError( "Invalid scale parameter. Scale must be a number." ) payload = {'figure': figure, 'format': format} if width is not None: payload['width'] = width if height is not None: payload['height'] = height if scale is not None: payload['scale'] = scale response = v2.images.create(payload) headers = response.headers if ('content-type' in headers and headers['content-type'] in ['image/png', 'image/jpeg', 'application/pdf', 'image/svg+xml']): return response.content elif ('content-type' in headers and 'json' in headers['content-type']): return response.json()['image'] @classmethod def ishow(cls, figure_or_data, format='png', width=None, height=None, scale=None): """Display a static image of the plot described by `figure_or_data` in an IPython Notebook. positional arguments: - figure_or_data: The figure dict-like or data list-like object that describes a plotly figure. Same argument used in `py.plot`, `py.iplot`, see https://plot.ly/python for examples - format: 'png', 'svg', 'jpeg', 'pdf' - width: output width - height: output height - scale: Increase the resolution of the image by `scale` amount Only valid for PNG and JPEG images. example: ``` import plotly.plotly as py fig = {'data': [{'x': [1, 2, 3], 'y': [3, 1, 5], 'type': 'bar'}]} py.image.ishow(fig, 'png', scale=3) """ if format == 'pdf': raise exceptions.PlotlyError( "Aw, snap! " "It's not currently possible to embed a pdf into " "an IPython notebook. You can save the pdf " "with the `image.save_as` or you can " "embed an png, jpeg, or svg.") img = cls.get(figure_or_data, format, width, height, scale) from IPython.display import display, Image, SVG if format == 'svg': display(SVG(img)) else: display(Image(img)) @classmethod def save_as(cls, figure_or_data, filename, format=None, width=None, height=None, scale=None): """Save a image of the plot described by `figure_or_data` locally as `filename`. Valid image formats are 'png', 'svg', 'jpeg', and 'pdf'. The format is taken as the extension of the filename or as the supplied format. positional arguments: - figure_or_data: The figure dict-like or data list-like object that describes a plotly figure. Same argument used in `py.plot`, `py.iplot`, see https://plot.ly/python for examples - filename: The filepath to save the image to - format: 'png', 'svg', 'jpeg', 'pdf' - width: output width - height: output height - scale: Increase the resolution of the image by `scale` amount Only valid for PNG and JPEG images. example: ``` import plotly.plotly as py fig = {'data': [{'x': [1, 2, 3], 'y': [3, 1, 5], 'type': 'bar'}]} py.image.save_as(fig, 'my_image.png', scale=3) ``` """ # todo: format shadows built-in name (base, ext) = os.path.splitext(filename) if not ext and not format: filename += '.png' elif ext and not format: format = ext[1:] elif not ext and format: filename += '.' + format img = cls.get(figure_or_data, format, width, height, scale) f = open(filename, 'wb') f.write(img) f.close() class file_ops: """ Interface to Plotly's File System API """ @classmethod def mkdirs(cls, folder_path): """ Create folder(s) specified by folder_path in your Plotly account. If the intermediate directories do not exist, they will be created. If they already exist, no error will be thrown. Mimics the shell's mkdir -p. Returns: - 200 if folders already existed, nothing was created - 201 if path was created Raises: - exceptions.PlotlyRequestError with status code 400 if the path already exists. Usage: >> mkdirs('new folder') >> mkdirs('existing folder/new folder') >> mkdirs('new/folder/path') """ response = v2.folders.create({'path': folder_path}) return response.status_code class grid_ops: """ Interface to Plotly's Grid API. Plotly Grids are Plotly's tabular data object, rendered in an online spreadsheet. Plotly graphs can be made from references of columns of Plotly grid objects. Free-form JSON Metadata can be saved with Plotly grids. To create a Plotly grid in your Plotly account from Python, see `grid_ops.upload`. To add rows or columns to an existing Plotly grid, see `grid_ops.append_rows` and `grid_ops.append_columns` respectively. To delete one of your grid objects, see `grid_ops.delete`. """ @classmethod def _fill_in_response_column_ids(cls, request_columns, response_columns, grid_id): for req_col in request_columns: for resp_col in response_columns: if resp_col['name'] == req_col.name: req_col.id = '{0}:{1}'.format(grid_id, resp_col['uid']) response_columns.remove(resp_col) @staticmethod def ensure_uploaded(fid): if fid: return raise exceptions.PlotlyError( 'This operation requires that the grid has already been uploaded ' 'to Plotly. Try `uploading` first.' ) @classmethod def upload(cls, grid, filename, world_readable=True, auto_open=True, meta=None): """ Upload a grid to your Plotly account with the specified filename. Positional arguments: - grid: A plotly.grid_objs.Grid object, call `help(plotly.grid_ops.Grid)` for more info. - filename: Name of the grid to be saved in your Plotly account. To save a grid in a folder in your Plotly account, separate specify a filename with folders and filename separated by backslashes (`/`). If a grid, plot, or folder already exists with the same filename, a `plotly.exceptions.RequestError` will be thrown with status_code 409 Optional keyword arguments: - world_readable (default=True): make this grid publically (True) or privately (False) viewable. - auto_open (default=True): Automatically open this grid in the browser (True) - meta (default=None): Optional Metadata to associate with this grid. Metadata is any arbitrary JSON-encodable object, for example: `{"experiment name": "GaAs"}` Filenames must be unique. To overwrite a grid with the same filename, you'll first have to delete the grid with the blocking name. See `plotly.plotly.grid_ops.delete`. Usage example 1: Upload a plotly grid ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') ``` Usage example 2: Make a graph based with data that is sourced from a newly uploaded Plotly grid ``` import plotly.plotly as py from plotly.grid_objs import Grid, Column from plotly.graph_objs import Scatter # Upload a grid column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') # Build a Plotly graph object sourced from the # grid's columns trace = Scatter(xsrc=grid[0], ysrc=grid[1]) py.plot([trace], filename='graph from grid') ``` """ # Make a folder path if filename[-1] == '/': filename = filename[0:-1] paths = filename.split('/') parent_path = '/'.join(paths[0:-1]) filename = paths[-1] if parent_path != '': file_ops.mkdirs(parent_path) # transmorgify grid object into plotly's format grid_json = grid._to_plotly_grid_json() if meta is not None: grid_json['metadata'] = meta payload = { 'filename': filename, 'data': grid_json, 'world_readable': world_readable } if parent_path != '': payload['parent_path'] = parent_path response = v2.grids.create(payload) parsed_content = response.json() cols = parsed_content['file']['cols'] fid = parsed_content['file']['fid'] web_url = parsed_content['file']['web_url'] # mutate the grid columns with the id's returned from the server cls._fill_in_response_column_ids(grid, cols, fid) grid.id = fid if meta is not None: meta_ops.upload(meta, grid=grid) if auto_open: _open_url(web_url) return web_url @classmethod def append_columns(cls, columns, grid=None, grid_url=None): """ Append columns to a Plotly grid. `columns` is an iterable of plotly.grid_objs.Column objects and only one of `grid` and `grid_url` needs to specified. `grid` is a ploty.grid_objs.Grid object that has already been uploaded to plotly with the grid_ops.upload method. `grid_url` is a unique URL of a `grid` in your plotly account. Usage example 1: Upload a grid to Plotly, and then append a column ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py column_1 = Column([1, 2, 3], 'time') grid = Grid([column_1]) py.grid_ops.upload(grid, 'time vs voltage') # append a column to the grid column_2 = Column([4, 2, 5], 'voltage') py.grid_ops.append_columns([column_2], grid=grid) ``` Usage example 2: Append a column to a grid that already exists on Plotly ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py grid_url = 'https://plot.ly/~chris/3143' column_1 = Column([1, 2, 3], 'time') py.grid_ops.append_columns([column_1], grid_url=grid_url) ``` """ grid_id = parse_grid_id_args(grid, grid_url) grid_ops.ensure_uploaded(grid_id) # Verify unique column names column_names = [c.name for c in columns] if grid: existing_column_names = [c.name for c in grid] column_names.extend(existing_column_names) duplicate_name = utils.get_first_duplicate(column_names) if duplicate_name: err = exceptions.NON_UNIQUE_COLUMN_MESSAGE.format(duplicate_name) raise exceptions.InputError(err) # This is sorta gross, we need to double-encode this. body = { 'cols': _json.dumps(columns, cls=utils.PlotlyJSONEncoder) } fid = grid_id response = v2.grids.col_create(fid, body) parsed_content = response.json() cls._fill_in_response_column_ids(columns, parsed_content['cols'], fid) if grid: grid.extend(columns) @classmethod def append_rows(cls, rows, grid=None, grid_url=None): """ Append rows to a Plotly grid. `rows` is an iterable of rows, where each row is a list of numbers, strings, or dates. The number of items in each row must be equal to the number of columns in the grid. If appending rows to a grid with columns of unequal length, Plotly will fill the columns with shorter length with empty strings. Only one of `grid` and `grid_url` needs to specified. `grid` is a ploty.grid_objs.Grid object that has already been uploaded to plotly with the grid_ops.upload method. `grid_url` is a unique URL of a `grid` in your plotly account. Usage example 1: Upload a grid to Plotly, and then append rows ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py column_1 = Column([1, 2, 3], 'time') column_2 = Column([5, 2, 7], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') # append a row to the grid row = [1, 5] py.grid_ops.append_rows([row], grid=grid) ``` Usage example 2: Append a row to a grid that already exists on Plotly ``` from plotly.grid_objs import Grid import plotly.plotly as py grid_url = 'https://plot.ly/~chris/3143' row = [1, 5] py.grid_ops.append_rows([row], grid=grid_url) ``` """ grid_id = parse_grid_id_args(grid, grid_url) grid_ops.ensure_uploaded(grid_id) if grid: n_columns = len([column for column in grid]) for row_i, row in enumerate(rows): if len(row) != n_columns: raise exceptions.InputError( "The number of entries in " "each row needs to equal the number of columns in " "the grid. Row {0} has {1} {2} but your " "grid has {3} {4}. " .format(row_i, len(row), 'entry' if len(row) == 1 else 'entries', n_columns, 'column' if n_columns == 1 else 'columns')) fid = grid_id v2.grids.row(fid, {'rows': rows}) if grid: longest_column_length = max([len(col.data) for col in grid]) for column in grid: n_empty_rows = longest_column_length - len(column.data) empty_string_rows = ['' for _ in range(n_empty_rows)] column.data.extend(empty_string_rows) column_extensions = zip(*rows) for local_column, column_extension in zip(grid, column_extensions): local_column.data.extend(column_extension) @classmethod def delete(cls, grid=None, grid_url=None): """ Delete a grid from your Plotly account. Only one of `grid` or `grid_url` needs to be specified. `grid` is a plotly.grid_objs.Grid object that has already been uploaded to Plotly. `grid_url` is the URL of the Plotly grid to delete Usage example 1: Upload a grid to plotly, then delete it ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') # now delete it, and free up that filename py.grid_ops.delete(grid) ``` Usage example 2: Delete a plotly grid by url ``` import plotly.plotly as py grid_url = 'https://plot.ly/~chris/3' py.grid_ops.delete(grid_url=grid_url) ``` """ fid = parse_grid_id_args(grid, grid_url) grid_ops.ensure_uploaded(fid) v2.grids.trash(fid) v2.grids.permanent_delete(fid) class meta_ops: """ Interface to Plotly's Metadata API. In Plotly, Metadata is arbitrary, free-form JSON data that is associated with Plotly grids. Metadata is viewable with any grid that is shared and grids are searchable by key value pairs in the Metadata. Metadata is any JSON-encodable object. To upload Metadata, either use the optional keyword argument `meta` in the `py.grid_ops.upload` method, or use `py.meta_ops.upload`. """ @classmethod def upload(cls, meta, grid=None, grid_url=None): """ Upload Metadata to a Plotly grid. Metadata is any JSON-encodable object. For example, a dictionary, string, or list. Only one of `grid` or `grid_url` needs to be specified. `grid` is a plotly.grid_objs.Grid object that has already been uploaded to Plotly. `grid_url` is the URL of the Plotly grid to attach Metadata to. Usage example 1: Upload a grid to Plotly, then attach Metadata to it ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') # now attach Metadata to the grid meta = {'experment': 'GaAs'} py.meta_ops.upload(meta, grid=grid) ``` Usage example 2: Upload Metadata to an existing Plotly grid ``` import plotly.plotly as py grid_url = 'https://plot.ly/~chris/3143' meta = {'experment': 'GaAs'} py.meta_ops.upload(meta, grid_url=grid_Url) ``` """ fid = parse_grid_id_args(grid, grid_url) return v2.grids.update(fid, {'metadata': meta}).json() def parse_grid_id_args(grid, grid_url): """ Return the grid_id from the non-None input argument. Raise an error if more than one argument was supplied. """ if grid is not None: id_from_grid = grid.id else: id_from_grid = None args = [id_from_grid, grid_url] arg_names = ('grid', 'grid_url') supplied_arg_names = [arg_name for arg_name, arg in zip(arg_names, args) if arg is not None] if not supplied_arg_names: raise exceptions.InputError( "One of the two keyword arguments is required:\n" " `grid` or `grid_url`\n\n" "grid: a plotly.graph_objs.Grid object that has already\n" " been uploaded to Plotly.\n\n" "grid_url: the url where the grid can be accessed on\n" " Plotly, e.g. 'https://plot.ly/~chris/3043'\n\n" ) elif len(supplied_arg_names) > 1: raise exceptions.InputError( "Only one of `grid` or `grid_url` is required. \n" "You supplied both. \n" ) else: supplied_arg_name = supplied_arg_names.pop() if supplied_arg_name == 'grid_url': path = six.moves.urllib.parse.urlparse(grid_url).path file_owner, file_id = path.replace("/~", "").split('/')[0:2] return '{0}:{1}'.format(file_owner, file_id) else: return grid.id def add_share_key_to_url(plot_url, attempt=0): """ Check that share key is enabled and update url to include the secret key """ urlsplit = six.moves.urllib.parse.urlparse(plot_url) username = urlsplit.path.split('/')[1].split('~')[1] idlocal = urlsplit.path.split('/')[2] fid = '{}:{}'.format(username, idlocal) body = {'share_key_enabled': True, 'world_readable': False} response = v2.files.update(fid, body) # Sometimes a share key is added, but access is still denied. # Check that share_key_enabled is set to true and # retry if this is not the case # https://github.com/plotly/streambed/issues/4089 time.sleep(4) share_key_enabled = v2.files.retrieve(fid).json()['share_key_enabled'] if not share_key_enabled: attempt += 1 if attempt == 50: raise exceptions.PlotlyError( "The sharekey could not be enabled at this time so the graph " "is saved as private. Try again to save as 'secret' later." ) add_share_key_to_url(plot_url, attempt) url_share_key = plot_url + '?share_key=' + response.json()['share_key'] return url_share_key def _send_to_plotly(figure, **plot_options): fig = tools._replace_newline(figure) # does not mutate figure data = fig.get('data', []) response = v1.clientresp(data, **plot_options) parsed_content = response.json() # Check if the url needs a secret key if plot_options['sharing'] == 'secret': url = parsed_content['url'] if 'share_key=' not in url: # add_share_key_to_url updates the url to include the share_key parsed_content['url'] = add_share_key_to_url(url) return parsed_content def get_grid(grid_url, raw=False): """ Returns the specified grid as a Grid instance or in JSON/dict form. :param (str) grid_url: The web_url which locates a Plotly grid. :param (bool) raw: if False, will output a Grid instance of the JSON grid being retrieved. If True, raw JSON will be returned. """ fid = parse_grid_id_args(None, grid_url) response = v2.grids.content(fid) parsed_content = response.json() if raw: return parsed_content return Grid(parsed_content, fid) class dashboard_ops: """ Interface to Plotly's Dashboards API. Plotly Dashboards are JSON blobs. They are made up by a bunch of containers which contain either empty boxes or boxes with file urls. For more info on Dashboard objects themselves, run `help(plotly.dashboard_objs)`. Example 1: Upload Simple Dashboard ``` import plotly.plotly as py import plotly.dashboard_objs as dashboard box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:123', 'title': 'box 1' } box_2 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:456', 'title': 'box 2' } my_dboard = dashboard.Dashboard() my_dboard.insert(box_1) # my_dboard.get_preview() my_dboard.insert(box_2, 'above', 1) # my_dboard.get_preview() py.dashboard_ops.upload(my_dboard) ``` Example 2: Retreive Dashboard from Plotly ``` # works if you have at least one dashboard in your files import plotly.plotly as py import plotly.dashboard_objs as dashboard dboard_names = get_dashboard_names() first_dboard = get_dashboard(dboard_names[0]) first_dboard.get_preview() ``` """ @classmethod def upload(cls, dashboard, filename, sharing='public', auto_open=True): """ BETA function for uploading/overwriting dashboards to Plotly. :param (dict) dashboard: the JSON dashboard to be uploaded. Use plotly.dashboard_objs.dashboard_objs to create a Dashboard object. :param (str) filename: the name of the dashboard to be saved in your Plotly account. Will overwrite a dashboard of the same name if it already exists in your files. :param (str) sharing: can be set to either 'public', 'private' or 'secret'. If 'public', your dashboard will be viewable by all other users. If 'private' only you can see your dashboard. If 'secret', the url will be returned with a sharekey appended to the url. Anyone with the url may view the dashboard. :param (bool) auto_open: automatically opens the dashboard in the browser. """ if sharing == 'public': world_readable = True elif sharing == 'private': world_readable = False elif sharing == 'secret': world_readable = False data = { 'content': json.dumps(dashboard), 'filename': filename, 'world_readable': world_readable } # lookup if pre-existing filename already exists try: lookup_res = v2.files.lookup(filename) matching_file = json.loads(lookup_res.content) if matching_file['filetype'] == 'dashboard': old_fid = matching_file['fid'] res = v2.dashboards.update(old_fid, data) else: raise exceptions.PlotlyError( "'{filename}' is already a {filetype} in your account. " "While you can overwrite dashboards with the same name, " "you can't change overwrite files with a different type. " "Try deleting '{filename}' in your account or changing " "the filename.".format( filename=filename, filetype=matching_file['filetype'] ) ) except exceptions.PlotlyRequestError: res = v2.dashboards.create(data) res.raise_for_status() url = res.json()['web_url'] if sharing == 'secret': url = add_share_key_to_url(url) if auto_open: webbrowser.open_new(res.json()['web_url']) return url @classmethod def _get_all_dashboards(cls): dashboards = [] res = v2.dashboards.list().json() for dashboard in res['results']: if not dashboard['deleted']: dashboards.append(dashboard) while res['next']: res = v2.utils.request('get', res['next']).json() for dashboard in res['results']: if not dashboard['deleted']: dashboards.append(dashboard) return dashboards @classmethod def _get_dashboard_json(cls, dashboard_name, only_content=True): dashboards = cls._get_all_dashboards() for index, dboard in enumerate(dashboards): if dboard['filename'] == dashboard_name: break dashboard = v2.utils.request( 'get', dashboards[index]['api_urls']['dashboards'] ).json() if only_content: dashboard_json = json.loads(dashboard['content']) return dashboard_json else: return dashboard @classmethod def get_dashboard(cls, dashboard_name): """Returns a Dashboard object from a dashboard name.""" dashboard_json = cls._get_dashboard_json(dashboard_name) return dashboard.Dashboard(dashboard_json) @classmethod def get_dashboard_names(cls): """Return list of all active dashboard names from users' account.""" dashboards = cls._get_all_dashboards() return [str(dboard['filename']) for dboard in dashboards] class presentation_ops: """ Interface to Plotly's Spectacle-Presentations API. """ @classmethod def upload(cls, presentation, filename, sharing='public', auto_open=True): """ Function for uploading presentations to Plotly. :param (dict) presentation: the JSON presentation to be uploaded. Use plotly.presentation_objs.Presentation to create presentations from a Markdown-like string. :param (str) filename: the name of the presentation to be saved in your Plotly account. Will overwrite a presentation of the same name if it already exists in your files. :param (str) sharing: can be set to either 'public', 'private' or 'secret'. If 'public', your presentation will be viewable by all other users. If 'private' only you can see your presentation. If it is set to 'secret', the url will be returned with a string of random characters appended to the url which is called a sharekey. The point of a sharekey is that it makes the url very hard to guess, but anyone with the url can view the presentation. :param (bool) auto_open: automatically opens the presentation in the browser. See the documentation online for examples. """ if sharing == 'public': world_readable = True elif sharing in ['private', 'secret']: world_readable = False else: raise exceptions.PlotlyError( SHARING_ERROR_MSG ) data = { 'content': json.dumps(presentation), 'filename': filename, 'world_readable': world_readable } # lookup if pre-existing filename already exists try: lookup_res = v2.files.lookup(filename) lookup_res.raise_for_status() matching_file = json.loads(lookup_res.content) if matching_file['filetype'] != 'spectacle_presentation': raise exceptions.PlotlyError( "'{filename}' is already a {filetype} in your account. " "You can't overwrite a file that is not a spectacle_" "presentation. Please pick another filename.".format( filename=filename, filetype=matching_file['filetype'] ) ) else: old_fid = matching_file['fid'] res = v2.spectacle_presentations.update(old_fid, data) except exceptions.PlotlyRequestError: res = v2.spectacle_presentations.create(data) res.raise_for_status() url = res.json()['web_url'] if sharing == 'secret': url = add_share_key_to_url(url) if auto_open: webbrowser.open_new(res.json()['web_url']) return url def create_animations(figure, filename=None, sharing='public', auto_open=True): """ BETA function that creates plots with animations via `frames`. Creates an animated plot using 'frames' alongside 'data' and 'layout'. This BETA endpoint is subject to deprecation in the future. In relation to `plotly.plotly.plot`, folder-creation and overwriting are not supported but creating a plot with or without animations via frames is supported. :param (str) filename: if set to 'None', an automatically-generated plot name will be created. Does not support folder creation, meaning that a folder of the form 'folder/name' will NOT create a the folder and place the plot in it. :param (str) sharing: see `plotly.plotly.plot()` doc string. :param (bool) auto_open: if True, opens plot in the browser. If False, returns the url for the plot instead. Example 1: Simple Animation ``` import plotly.plotly as py from plotly.grid_objs import Grid, Column column_1 = Column([0.5], 'x') column_2 = Column([0.5], 'y') column_3 = Column([1.5], 'x2') column_4 = Column([1.5], 'y2') grid = Grid([column_1, column_2, column_3, column_4]) py.grid_ops.upload(grid, 'ping_pong_grid', auto_open=False) # create figure figure = { 'data': [ { 'xsrc': grid.get_column_reference('x'), 'ysrc': grid.get_column_reference('y'), 'mode': 'markers', } ], 'layout': {'title': 'Ping Pong Animation', 'xaxis': {'range': [0, 2], 'autorange': False}, 'yaxis': {'range': [0, 2], 'autorange': False}, 'updatemenus': [{ 'buttons': [ {'args': [None], 'label': u'Play', 'method': u'animate'} ], 'pad': {'r': 10, 't': 87}, 'showactive': False, 'type': 'buttons' }]}, 'frames': [ { 'data': [ { 'xsrc': grid.get_column_reference('x2'), 'ysrc': grid.get_column_reference('y2'), 'mode': 'markers', } ] }, { 'data': [ { 'xsrc': grid.get_column_reference('x'), 'ysrc': grid.get_column_reference('y'), 'mode': 'markers', } ] } ] } py.create_animations(figure, 'ping_pong') ``` Example 2: Growing Circles Animation ``` import plotly.plotly as py from plotly.grid_objs import Grid, Column column_1 = Column([0.9, 1.1], 'x') column_2 = Column([1.0, 1.0], 'y') column_3 = Column([0.8, 1.2], 'x2') column_4 = Column([1.2, 0.8], 'y2') column_5 = Column([0.7, 1.3], 'x3') column_6 = Column([0.7, 1.3], 'y3') column_7 = Column([0.6, 1.4], 'x4') column_8 = Column([1.5, 0.5], 'y4') column_9 = Column([0.4, 1.6], 'x5') column_10 = Column([1.2, 0.8], 'y5') grid = Grid([column_1, column_2, column_3, column_4, column_5, column_6, column_7, column_8, column_9, column_10]) py.grid_ops.upload(grid, 'growing_circles_grid', auto_open=False) # create figure figure = { 'data': [ { 'xsrc': grid.get_column_reference('x'), 'ysrc': grid.get_column_reference('y'), 'mode': 'markers', 'marker': {'color': '#48186a', 'size': 10} } ], 'layout': {'title': 'Growing Circles', 'xaxis': {'range': [0, 2], 'autorange': False}, 'yaxis': {'range': [0, 2], 'autorange': False}, 'updatemenus': [{ 'buttons': [ {'args': [None], 'label': u'Play', 'method': u'animate'} ], 'pad': {'r': 10, 't': 87}, 'showactive': False, 'type': 'buttons' }]}, 'frames': [ { 'data': [ { 'xsrc': grid.get_column_reference('x2'), 'ysrc': grid.get_column_reference('y2'), 'mode': 'markers', 'marker': {'color': '#3b528b', 'size': 25} } ] }, { 'data': [ { 'xsrc': grid.get_column_reference('x3'), 'ysrc': grid.get_column_reference('y3'), 'mode': 'markers', 'marker': {'color': '#26828e', 'size': 50} } ] }, { 'data': [ { 'xsrc': grid.get_column_reference('x4'), 'ysrc': grid.get_column_reference('y4'), 'mode': 'markers', 'marker': {'color': '#5ec962', 'size': 80} } ] }, { 'data': [ { 'xsrc': grid.get_column_reference('x5'), 'ysrc': grid.get_column_reference('y5'), 'mode': 'markers', 'marker': {'color': '#d8e219', 'size': 100} } ] } ] } py.create_animations(figure, 'growing_circles') ``` """ body = { 'figure': figure, 'world_readable': True } # set filename if specified if filename: # warn user that creating folders isn't support in this version if '/' in filename: warnings.warn( "This BETA version of 'create_animations' does not support " "automatic folder creation. This means a filename of the form " "'name1/name2' will just create the plot with that name only." ) body['filename'] = filename # set sharing if sharing == 'public': body['world_readable'] = True elif sharing == 'private': body['world_readable'] = False elif sharing == 'secret': body['world_readable'] = False body['share_key_enabled'] = True else: raise exceptions.PlotlyError( SHARING_ERROR_MSG ) response = v2.plots.create(body) parsed_content = response.json() if sharing == 'secret': web_url = (parsed_content['file']['web_url'][:-1] + '?share_key=' + parsed_content['file']['share_key']) else: web_url = parsed_content['file']['web_url'] if auto_open: _open_url(web_url) return web_url def icreate_animations(figure, filename=None, sharing='public', auto_open=False): """ Create a unique url for this animated plot in Plotly and open in IPython. This function is based off `plotly.plotly.iplot`. See `plotly.plotly. create_animations` Doc String for param descriptions. """ url = create_animations(figure, filename, sharing, auto_open) if isinstance(figure, dict): layout = figure.get('layout', {}) else: layout = {} embed_options = dict() embed_options['width'] = layout.get('width', '100%') embed_options['height'] = layout.get('height', 525) try: float(embed_options['width']) except (ValueError, TypeError): pass else: embed_options['width'] = str(embed_options['width']) + 'px' try: float(embed_options['height']) except (ValueError, TypeError): pass else: embed_options['height'] = str(embed_options['height']) + 'px' return tools.embed(url, **embed_options) def _open_url(url): try: from webbrowser import open as wbopen wbopen(url) except: # TODO: what should we except here? this is dangerous pass plotly-2.2.3+dfsg.orig/plotly/plotly/chunked_requests/0000755000175000017500000000000013211605515022470 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/plotly/chunked_requests/chunked_request.py0000644000175000017500000002764613104403274026251 0ustar noahfxnoahfximport time import six import os import ssl from six.moves import http_client from six.moves.urllib.parse import urlparse class Stream: def __init__(self, server, port=80, headers={}, url='/', ssl_enabled=False, ssl_verification_enabled=True): ''' Initialize a stream object and an HTTP or HTTPS connection with chunked Transfer-Encoding to server:port with optional headers. ''' self.maxtries = 5 self._tries = 0 self._delay = 1 self._closed = False self._server = server self._port = port self._headers = headers self._url = url self._ssl_enabled = ssl_enabled self._ssl_verification_enabled = ssl_verification_enabled self._connect() def write(self, data, reconnect_on=('', 200, )): ''' Send `data` to the server in chunk-encoded form. Check the connection before writing and reconnect if disconnected and if the response status code is in `reconnect_on`. The response may either be an HTTPResponse object or an empty string. ''' if not self._isconnected(): # Attempt to get the response. response = self._getresponse() # Reconnect depending on the status code. if ((response == '' and '' in reconnect_on) or (response and isinstance(response, http_client.HTTPResponse) and response.status in reconnect_on)): self._reconnect() elif response and isinstance(response, http_client.HTTPResponse): # If an HTTPResponse was recieved then # make the users aware instead of # auto-reconnecting in case the # server is responding with an important # message that might prevent # future requests from going through, # like Invalid Credentials. # This allows the user to determine when # to reconnect. raise Exception("Server responded with " "status code: {status_code}\n" "and message: {msg}." .format(status_code=response.status, msg=response.read())) elif response == '': raise Exception("Attempted to write but socket " "was not connected.") try: msg = data msglen = format(len(msg), 'x') # msg length in hex # Send the message in chunk-encoded form self._conn.sock.setblocking(1) self._conn.send('{msglen}\r\n{msg}\r\n' .format(msglen=msglen, msg=msg).encode('utf-8')) self._conn.sock.setblocking(0) except http_client.socket.error: self._reconnect() self.write(data) def _get_proxy_config(self): """ Determine if self._url should be passed through a proxy. If so, return the appropriate proxy_server and proxy_port. Assumes https_proxy is used when ssl_enabled=True. """ proxy_server = None proxy_port = None ssl_enabled = self._ssl_enabled if ssl_enabled: proxy = os.environ.get("https_proxy") else: proxy = os.environ.get("http_proxy") no_proxy = os.environ.get("no_proxy") no_proxy_url = no_proxy and self._server in no_proxy if proxy and not no_proxy_url: p = urlparse(proxy) proxy_server = p.hostname proxy_port = p.port return proxy_server, proxy_port def _get_ssl_context(self): """ Return an unverified context if ssl verification is disabled. """ context = None if not self._ssl_verification_enabled: context = ssl._create_unverified_context() return context def _connect(self): ''' Initialize an HTTP/HTTPS connection with chunked Transfer-Encoding to server:port with optional headers. ''' server = self._server port = self._port headers = self._headers ssl_enabled = self._ssl_enabled proxy_server, proxy_port = self._get_proxy_config() if (proxy_server and proxy_port): if ssl_enabled: context = self._get_ssl_context() self._conn = http_client.HTTPSConnection( proxy_server, proxy_port, context=context ) else: self._conn = http_client.HTTPConnection( proxy_server, proxy_port ) self._conn.set_tunnel(server, port) else: if ssl_enabled: context = self._get_ssl_context() self._conn = http_client.HTTPSConnection( server, port, context=context ) else: self._conn = http_client.HTTPConnection(server, port) self._conn.putrequest('POST', self._url) self._conn.putheader('Transfer-Encoding', 'chunked') for header in headers: self._conn.putheader(header, headers[header]) self._conn.endheaders() # Set blocking to False prevents recv # from blocking while waiting for a response. self._conn.sock.setblocking(False) self._bytes = six.b('') self._reset_retries() time.sleep(0.5) def close(self): ''' Close the connection to server. If available, return a http_client.HTTPResponse object. Closing the connection involves sending the Transfer-Encoding terminating bytes. ''' self._reset_retries() self._closed = True # Chunked-encoded posts are terminated with '0\r\n\r\n' # For some reason, either Python or node.js seems to # require an extra \r\n. try: self._conn.send('\r\n0\r\n\r\n'.encode('utf-8')) except http_client.socket.error: # In case the socket has already been closed return '' return self._getresponse() def _getresponse(self): ''' Read from recv and return a HTTPResponse object if possible. Either 1 - The client has succesfully closed the connection: Return '' 2 - The server has already closed the connection: Return the response if possible. ''' # Wait for a response self._conn.sock.setblocking(True) # Parse the response response = self._bytes while True: try: _bytes = self._conn.sock.recv(1) except http_client.socket.error: # For error 54: Connection reset by peer # (and perhaps others) return six.b('') if _bytes == six.b(''): break else: response += _bytes # Set recv to be non-blocking again self._conn.sock.setblocking(False) # Convert the response string to a http_client.HTTPResponse # object with a bit of a hack if response != six.b(''): # Taken from # http://pythonwise.blogspot.ca/2010/02/parse-http-response.html try: response = http_client.HTTPResponse(_FakeSocket(response)) response.begin() except: # Bad headers ... etc. response = six.b('') return response def _isconnected(self): ''' Return True if the socket is still connected to the server, False otherwise. This check is done in 3 steps: 1 - Check if we have closed the connection 2 - Check if the original socket connection failed 3 - Check if the server has returned any data. If they have, assume that the server closed the response after they sent the data, i.e. that the data was the HTTP response. ''' # 1 - check if we've closed the connection. if self._closed: return False # 2 - Check if the original socket connection failed # If this failed, then no socket was initialized if self._conn.sock is None: return False try: # 3 - Check if the server has returned any data. # If they have, then start to store the response # in _bytes. self._bytes = six.b('') self._bytes = self._conn.sock.recv(1) return False except http_client.socket.error as e: # Check why recv failed # Windows machines are the error codes # that start with 1 # (http://msdn.microsoft.com/en-ca/library/windows/desktop/ms740668(v=vs.85).aspx) if e.errno == 35 or e.errno == 10035: # This is the "Resource temporarily unavailable" error # which is thrown cuz there was nothing to receive, i.e. # the server hasn't returned a response yet. # This is a non-fatal error and the operation # should be tried again. # So, assume that the connection is still open. return True elif e.errno == 54 or e.errno == 10054: # This is the "Connection reset by peer" error # which is thrown cuz the server reset the # socket, so the connection is closed. return False elif e.errno == 11: # This is the "Resource temporarily unavailable" error # which happens because the "operation would have blocked # but nonblocking operation was requested". # We require non-blocking reading of this socket because # we don't want to wait around for a response, we just # want to see if a response is currently available. So # let's just assume that we're still connected and # hopefully recieve some data on the next try. return True elif isinstance(e, ssl.SSLError): if e.errno == 2: # errno 2 occurs when trying to read or write data, but more # data needs to be received on the underlying TCP transport # before the request can be fulfilled. # # Python 2.7.9+ and Python 3.3+ give this its own exception, # SSLWantReadError return True raise e else: # Unknown scenario raise e def _reconnect(self): ''' Connect if disconnected. Retry self.maxtries times with delays ''' if not self._isconnected(): try: self._connect() except http_client.socket.error as e: # Attempt to reconnect if the connection was refused if e.errno == 61 or e.errno == 10061: # errno 61 is the "Connection Refused" error time.sleep(self._delay) self._delay += self._delay # fibonacii delays self._tries += 1 if self._tries < self.maxtries: self._reconnect() else: self._reset_retries() raise e else: # Unknown scenario raise e # Reconnect worked - reset _closed self._closed = False def _reset_retries(self): ''' Reset the connect counters and delays ''' self._tries = 0 self._delay = 1 class _FakeSocket(six.StringIO): # Used to construct a http_client.HTTPResponse object # from a string. # Thx to: http://pythonwise.blogspot.ca/2010/02/parse-http-response.html def makefile(self, *args, **kwargs): return self plotly-2.2.3+dfsg.orig/plotly/plotly/chunked_requests/__init__.py0000644000175000017500000000004413104403274024576 0ustar noahfxnoahfxfrom . chunked_request import Streamplotly-2.2.3+dfsg.orig/plotly/plotly/__init__.py0000644000175000017500000000107613174436015021236 0ustar noahfxnoahfx""" plotly ====== This module defines functionality that requires interaction between your local machine and Plotly. Almost all functionality used here will require a verifiable account (username/api-key pair) and a network connection. """ from . plotly import ( sign_in, update_plot_options, get_credentials, iplot, plot, iplot_mpl, plot_mpl, get_figure, Stream, image, grid_ops, meta_ops, file_ops, get_config, get_grid, dashboard_ops, presentation_ops, create_animations, icreate_animations ) plotly-2.2.3+dfsg.orig/plotly/presentation_objs/0000755000175000017500000000000013211605515021321 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/presentation_objs/presentation_objs.py0000644000175000017500000012350413174472664025447 0ustar noahfxnoahfx""" dashboard_objs ========== A module for creating and manipulating spectacle-presentation dashboards. """ import copy import random import re import string import warnings from plotly import exceptions from plotly.config import get_config HEIGHT = 700.0 WIDTH = 1000.0 CODEPANE_THEMES = ['tomorrow', 'tomorrowNight'] VALID_LANGUAGES = ['cpp', 'cs', 'css', 'fsharp', 'go', 'haskell', 'java', 'javascript', 'jsx', 'julia', 'xml', 'matlab', 'php', 'python', 'r', 'ruby', 'scala', 'sql', 'yaml'] VALID_TRANSITIONS = ['slide', 'zoom', 'fade', 'spin'] PRES_THEMES = ['moods', 'martik'] VALID_GROUPTYPES = [ 'leftgroup_v', 'rightgroup_v', 'middle', 'checkerboard_topleft', 'checkerboard_topright' ] fontWeight_dict = { 'Thin': {'fontWeight': 100}, 'Thin Italic': {'fontWeight': 100, 'fontStyle': 'italic'}, 'Light': {'fontWeight': 300}, 'Light Italic': {'fontWeight': 300, 'fontStyle': 'italic'}, 'Regular': {'fontWeight': 400}, 'Regular Italic': {'fontWeight': 400, 'fontStyle': 'italic'}, 'Medium': {'fontWeight': 500}, 'Medium Italic': {'fontWeight': 500, 'fontStyle': 'italic'}, 'Bold': {'fontWeight': 700}, 'Bold Italic': {'fontWeight': 700, 'fontStyle': 'italic'}, 'Black': {'fontWeight': 900}, 'Black Italic': {'fontWeight': 900, 'fontStyle': 'italic'}, } def list_of_options(iterable, conj='and', period=True): """ Returns an English listing of objects seperated by commas ',' For example, ['foo', 'bar', 'baz'] becomes 'foo, bar and baz' if the conjunction 'and' is selected. """ if len(iterable) < 2: raise exceptions.PlotlyError( 'Your list or tuple must contain at least 2 items.' ) template = (len(iterable) - 2)*'{}, ' + '{} ' + conj + ' {}' + period*'.' return template.format(*iterable) # Error Messages STYLE_ERROR = "Your presentation style must be {}".format( list_of_options(PRES_THEMES, conj='or', period=True) ) CODE_ENV_ERROR = ( "If you are putting a block of code into your markdown " "presentation, make sure your denote the start and end " "of the code environment with the '```' characters. For " "example, your markdown string would include something " "like:\n\n```python\nx = 2\ny = 1\nprint x\n```\n\n" "Notice how the language that you want the code to be " "displayed in is immediately to the right of first " "entering '```', i.e. '```python'." ) LANG_ERROR = ( "The language of your code block should be " "clearly indicated after the first ``` that " "begins the code block. The valid languages to " "choose from are" + list_of_options( VALID_LANGUAGES ) ) def _generate_id(size): letters_and_numbers = string.ascii_letters for num in range(10): letters_and_numbers += str(num) letters_and_numbers += str(num) id_str = '' for _ in range(size): id_str += random.choice(list(letters_and_numbers)) return id_str paragraph_styles = { 'Body': { 'color': '#3d3d3d', 'fontFamily': 'Open Sans', 'fontSize': 11, 'fontStyle': 'normal', 'fontWeight': 400, 'lineHeight': 'normal', 'minWidth': 20, 'opacity': 1, 'textAlign': 'center', 'textDecoration': 'none', 'wordBreak': 'break-word' }, 'Body Small': { 'color': '#3d3d3d', 'fontFamily': 'Open Sans', 'fontSize': 10, 'fontStyle': 'normal', 'fontWeight': 400, 'lineHeight': 'normal', 'minWidth': 20, 'opacity': 1, 'textAlign': 'center', 'textDecoration': 'none' }, 'Caption': { 'color': '#3d3d3d', 'fontFamily': 'Open Sans', 'fontSize': 11, 'fontStyle': 'italic', 'fontWeight': 400, 'lineHeight': 'normal', 'minWidth': 20, 'opacity': 1, 'textAlign': 'center', 'textDecoration': 'none' }, 'Heading 1': { 'color': '#3d3d3d', 'fontFamily': 'Open Sans', 'fontSize': 26, 'fontStyle': 'normal', 'fontWeight': 400, 'lineHeight': 'normal', 'minWidth': 20, 'opacity': 1, 'textAlign': 'center', 'textDecoration': 'none', }, 'Heading 2': { 'color': '#3d3d3d', 'fontFamily': 'Open Sans', 'fontSize': 20, 'fontStyle': 'normal', 'fontWeight': 400, 'lineHeight': 'normal', 'minWidth': 20, 'opacity': 1, 'textAlign': 'center', 'textDecoration': 'none' }, 'Heading 3': { 'color': '#3d3d3d', 'fontFamily': 'Open Sans', 'fontSize': 11, 'fontStyle': 'normal', 'fontWeight': 700, 'lineHeight': 'normal', 'minWidth': 20, 'opacity': 1, 'textAlign': 'center', 'textDecoration': 'none' } } def _empty_slide(transition, id): empty_slide = {'children': [], 'id': id, 'props': {'style': {}, 'transition': transition}} return empty_slide def _box(boxtype, text_or_url, left, top, height, width, id, props_attr, style_attr, paragraphStyle): children_list = [] fontFamily = "Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace" if boxtype == 'Text': children_list = text_or_url.split('\n') props = { 'isQuote': False, 'listType': None, 'paragraphStyle': paragraphStyle, 'size': 4, 'style': copy.deepcopy(paragraph_styles[paragraphStyle]) } props['style'].update( {'height': height, 'left': left, 'top': top, 'width': width, 'position': 'absolute'} ) elif boxtype == 'Image': # height, width are set to default 512 # as set by the Presentation Editor props = { 'height': 512, 'imageName': None, 'src': text_or_url, 'style': {'height': height, 'left': left, 'opacity': 1, 'position': 'absolute', 'top': top, 'width': width}, 'width': 512 } elif boxtype == 'Plotly': if '?share_key' in text_or_url: src = text_or_url else: src = text_or_url + '.embed?link=false' props = { 'frameBorder': 0, 'scrolling': 'no', 'src': src, 'style': {'height': height, 'left': left, 'position': 'absolute', 'top': top, 'width': width} } elif boxtype == 'CodePane': props = { 'language': 'python', 'source': text_or_url, 'style': {'fontFamily': fontFamily, 'fontSize': 13, 'height': height, 'left': left, 'margin': 0, 'position': 'absolute', 'textAlign': 'left', 'top': top, 'width': width}, 'theme': 'tomorrowNight' } # update props and style attributes for item in props_attr.items(): props[item[0]] = item[1] for item in style_attr.items(): props['style'][item[0]] = item[1] child = { 'children': children_list, 'id': id, 'props': props, 'type': boxtype } if boxtype == 'Text': child['defaultHeight'] = 36 child['defaultWidth'] = 52 child['resizeVertical'] = False if boxtype == 'CodePane': child['defaultText'] = 'Code' return child def _percentage_to_pixel(value, side): if side == 'left': return WIDTH * (0.01 * value) elif side == 'top': return HEIGHT * (0.01 * value) elif side == 'height': return HEIGHT * (0.01 * value) elif side == 'width': return WIDTH * (0.01 * value) def _return_box_position(left, top, height, width): values_dict = { 'left': left, 'top': top, 'height': height, 'width': width, } for key in iter(values_dict): if isinstance(values_dict[key], str): var = float(values_dict[key][: -2]) else: var = _percentage_to_pixel(values_dict[key], key) values_dict[key] = var return (values_dict['left'], values_dict['top'], values_dict['height'], values_dict['width']) def _remove_extra_whitespace_from_line(line): line = line.lstrip() line = line.rstrip() return line def _list_of_slides(markdown_string): if not markdown_string.endswith('\n---\n'): markdown_string += '\n---\n' text_blocks = re.split('\n-{2,}\n', markdown_string) list_of_slides = [] for text in text_blocks: if not all(char in ['\n', '-', ' '] for char in text): list_of_slides.append(text) if '\n-\n' in markdown_string: msg = ("You have at least one '-' by itself on its own line in your " "markdown string. If you are trying to denote a new slide, " "make sure that the line has 3 '-'s like this: \n\n---\n\n" "A new slide will NOT be created here.") warnings.warn(msg) return list_of_slides def _top_spec_for_text_at_bottom(text_block, width_per, per_from_bottom=0, min_top=30): # This function ensures that if there is a large block of # text in your slide it will not overflow off the bottom # of the slide. # The input for this function are a block of text and the # params that define where it will be placed in the slide. # The function makes some calculations and will output a # 'top' value (i.e. the left, top, height, width css params) # so that the text block will come down to some specified # distance from the bottom of the page. # TODO: customize this function for different fonts/sizes max_lines = 37 one_char_percent_width = 0.764 chars_in_full_line = width_per / one_char_percent_width num_of_lines = 0 char_group = 0 for char in text_block: if char == '\n': num_of_lines += 1 char_group = 0 else: if char_group >= chars_in_full_line: char_group = 0 num_of_lines += 1 else: char_group += 1 num_of_lines += 1 top_frac = (max_lines - num_of_lines) / float(max_lines) top = top_frac * 100 - per_from_bottom # to be safe return max(top, min_top) def _box_specs_gen(num_of_boxes, grouptype='leftgroup_v', width_range=50, height_range=50, margin=2, betw_boxes=4, middle_center=50): # the (left, top, width, height) specs # are added to specs_for_boxes specs_for_boxes = [] if num_of_boxes == 1 and grouptype in ['leftgroup_v', 'rightgroup_v']: if grouptype == 'rightgroup_v': left_shift = (100 - width_range) else: left_shift = 0 box_spec = ( left_shift + (margin / WIDTH) * 100, (margin / HEIGHT) * 100, 100 - (2 * margin / HEIGHT * 100), width_range - (2 * margin / WIDTH) * 100 ) specs_for_boxes.append(box_spec) elif num_of_boxes > 1 and grouptype in ['leftgroup_v', 'rightgroup_v']: if grouptype == 'rightgroup_v': left_shift = (100 - width_range) else: left_shift = 0 if num_of_boxes % 2 == 0: box_width_px = 0.5 * ( (float(width_range)/100) * WIDTH - 2 * margin - betw_boxes ) box_width = (box_width_px / WIDTH) * 100 height = (200.0 / (num_of_boxes * HEIGHT)) * ( HEIGHT - (num_of_boxes / 2 - 1) * betw_boxes - 2 * margin ) left1 = left_shift + (margin / WIDTH) * 100 left2 = left_shift + ( ((margin + betw_boxes) / WIDTH) * 100 + box_width ) for left in [left1, left2]: for j in range(int(num_of_boxes / 2)): top = (margin * 100 / HEIGHT) + j * ( height + (betw_boxes * 100 / HEIGHT) ) specs = ( left, top, height, box_width ) specs_for_boxes.append(specs) if num_of_boxes % 2 == 1: width = width_range - (200 * margin) / WIDTH height = (100.0 / (num_of_boxes * HEIGHT)) * ( HEIGHT - (num_of_boxes - 1) * betw_boxes - 2 * margin ) left = left_shift + (margin / WIDTH) * 100 for j in range(num_of_boxes): top = (margin / HEIGHT) * 100 + j * ( height + (betw_boxes / HEIGHT) * 100 ) specs = ( left, top, height, width ) specs_for_boxes.append(specs) elif grouptype == 'middle': top = float(middle_center - (height_range / 2)) height = height_range width = (1 / float(num_of_boxes)) * ( width_range - (num_of_boxes - 1) * (100*betw_boxes/WIDTH) ) for j in range(num_of_boxes): left = ((100 - float(width_range)) / 2) + j * ( width + (betw_boxes / WIDTH) * 100 ) specs = (left, top, height, width) specs_for_boxes.append(specs) elif 'checkerboard' in grouptype and num_of_boxes == 2: if grouptype == 'checkerboard_topleft': for j in range(2): left = j * 50 top = j * 50 height = 50 width = 50 specs = ( left, top, height, width ) specs_for_boxes.append(specs) else: for j in range(2): left = 50 * (1 - j) top = j * 50 height = 50 width = 50 specs = ( left, top, height, width ) specs_for_boxes.append(specs) return specs_for_boxes def _return_layout_specs(num_of_boxes, url_lines, title_lines, text_block, code_blocks, slide_num, style): # returns specs of the form (left, top, height, width) code_theme = 'tomorrowNight' if style == 'martik': specs_for_boxes = [] margin = 18 # in pxs # set Headings styles paragraph_styles['Heading 1'].update( {'color': '#0D0A1E', 'fontFamily': 'Raleway', 'fontSize': 55, 'fontWeight': fontWeight_dict['Bold']['fontWeight']} ) paragraph_styles['Heading 2'] = copy.deepcopy( paragraph_styles['Heading 1'] ) paragraph_styles['Heading 2'].update({'fontSize': 36}) paragraph_styles['Heading 3'] = copy.deepcopy( paragraph_styles['Heading 1'] ) paragraph_styles['Heading 3'].update({'fontSize': 30}) # set Body style paragraph_styles['Body'].update( {'color': '#96969C', 'fontFamily': 'Roboto', 'fontSize': 16, 'fontWeight': fontWeight_dict['Regular']['fontWeight']} ) bkgd_color = '#F4FAFB' title_font_color = '#0D0A1E' text_font_color = '#96969C' if num_of_boxes == 0 and slide_num == 0: text_textAlign = 'center' else: text_textAlign = 'left' if num_of_boxes == 0: specs_for_title = (0, 50, 20, 100) specs_for_text = (15, 60, 50, 70) bkgd_color = '#0D0A1E' title_font_color = '#F4FAFB' text_font_color = '#F4FAFB' elif num_of_boxes == 1: if code_blocks != [] or (url_lines != [] and get_config()['plotly_domain'] in url_lines[0]): if code_blocks != []: w_range = 40 else: w_range = 60 text_top = _top_spec_for_text_at_bottom( text_block, 80, per_from_bottom=(margin / HEIGHT) * 100 ) specs_for_title = (0, 3, 20, 100) specs_for_text = (10, text_top, 30, 80) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='middle', width_range=w_range, height_range=60, margin=margin, betw_boxes=4 ) bkgd_color = '#0D0A1E' title_font_color = '#F4FAFB' text_font_color = '#F4FAFB' code_theme = 'tomorrow' elif title_lines == [] and text_block == '': specs_for_title = (0, 50, 20, 100) specs_for_text = (15, 60, 50, 70) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='middle', width_range=50, height_range=80, margin=0, betw_boxes=0 ) else: title_text_width = 40 - (margin / WIDTH) * 100 text_top = _top_spec_for_text_at_bottom( text_block, title_text_width, per_from_bottom=(margin / HEIGHT) * 100 ) specs_for_title = (60, 3, 20, 40) specs_for_text = (60, text_top, 1, title_text_width) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='leftgroup_v', width_range=60, margin=margin, betw_boxes=4 ) bkgd_color = '#0D0A1E' title_font_color = '#F4FAFB' text_font_color = '#F4FAFB' elif num_of_boxes == 2 and url_lines != []: text_top = _top_spec_for_text_at_bottom( text_block, 46, per_from_bottom=(margin / HEIGHT) * 100, min_top=50 ) specs_for_title = (0, 3, 20, 50) specs_for_text = (52, text_top, 40, 46) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='checkerboard_topright' ) elif num_of_boxes >= 2 and url_lines == []: text_top = _top_spec_for_text_at_bottom( text_block, 92, per_from_bottom=(margin / HEIGHT) * 100, min_top=15 ) if num_of_boxes == 2: betw_boxes = 90 else: betw_boxes = 10 specs_for_title = (0, 3, 20, 100) specs_for_text = (4, text_top, 1, 92) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='middle', width_range=92, height_range=60, margin=margin, betw_boxes=betw_boxes ) code_theme = 'tomorrow' else: text_top = _top_spec_for_text_at_bottom( text_block, 40 - (margin / WIDTH) * 100, per_from_bottom=(margin / HEIGHT) * 100 ) specs_for_title = (0, 3, 20, 40 - (margin / WIDTH) * 100) specs_for_text = ( (margin / WIDTH) * 100, text_top, 50, 40 - (margin / WIDTH) * 100 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='rightgroup_v', width_range=60, margin=margin, betw_boxes=4 ) elif style == 'moods': specs_for_boxes = [] margin = 18 code_theme = 'tomorrowNight' # set Headings styles paragraph_styles['Heading 1'].update( {'color': '#000016', 'fontFamily': 'Roboto', 'fontSize': 55, 'fontWeight': fontWeight_dict['Black']['fontWeight']} ) paragraph_styles['Heading 2'] = copy.deepcopy( paragraph_styles['Heading 1'] ) paragraph_styles['Heading 2'].update({'fontSize': 36}) paragraph_styles['Heading 3'] = copy.deepcopy( paragraph_styles['Heading 1'] ) paragraph_styles['Heading 3'].update({'fontSize': 30}) # set Body style paragraph_styles['Body'].update( {'color': '#000016', 'fontFamily': 'Roboto', 'fontSize': 16, 'fontWeight': fontWeight_dict['Thin']['fontWeight']} ) bkgd_color = '#FFFFFF' title_font_color = None text_font_color = None if num_of_boxes == 0 and slide_num == 0: text_textAlign = 'center' else: text_textAlign = 'left' if num_of_boxes == 0: if slide_num == 0 or text_block == '': bkgd_color = '#F7F7F7' specs_for_title = (0, 50, 20, 100) specs_for_text = (15, 60, 50, 70) else: bkgd_color = '#F7F7F7' text_top = _top_spec_for_text_at_bottom( text_block, width_per=90, per_from_bottom=(margin / HEIGHT) * 100, min_top=20 ) specs_for_title = (0, 2, 20, 100) specs_for_text = (5, text_top, 50, 90) elif num_of_boxes == 1: if code_blocks != []: # code if text_block == '': margin = 5 specs_for_title = (0, 3, 20, 100) specs_for_text = (0, 0, 0, 0) top = 12 specs_for_boxes = [ (margin, top, 100 - top - margin, 100 - 2 * margin) ] elif slide_num % 2 == 0: # middle center width_per = 90 height_range = 60 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=100 - height_range / 2. ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='middle', width_range=50, height_range=60, margin=margin, ) specs_for_title = (0, 3, 20, 100) specs_for_text = ( 5, text_top, 2, width_per ) else: # right width_per = 50 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=30 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='rightgroup_v', width_range=50, margin=40, ) specs_for_title = (0, 3, 20, 50) specs_for_text = ( 2, text_top, 2, width_per - 2 ) elif (url_lines != [] and get_config()['plotly_domain'] in url_lines[0]): # url if slide_num % 2 == 0: # top half width_per = 95 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=60 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='middle', width_range=100, height_range=60, middle_center=30 ) specs_for_title = (0, 60, 20, 100) specs_for_text = ( 2.5, text_top, 2, width_per ) else: # middle across width_per = 95 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=60 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='middle', width_range=100, height_range=60 ) specs_for_title = (0, 3, 20, 100) specs_for_text = ( 2.5, text_top, 2, width_per ) else: # image if slide_num % 2 == 0: # right width_per = 50 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=30 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='rightgroup_v', width_range=50, margin=0, ) specs_for_title = (0, 3, 20, 50) specs_for_text = ( 2, text_top, 2, width_per - 2 ) else: # left width_per = 50 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=30 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='leftgroup_v', width_range=50, margin=0, ) specs_for_title = (50, 3, 20, 50) specs_for_text = ( 52, text_top, 2, width_per - 2 ) elif num_of_boxes == 2: # right stack width_per = 50 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=30 ) specs_for_boxes = [(50, 0, 50, 50), (50, 50, 50, 50)] specs_for_title = (0, 3, 20, 50) specs_for_text = ( 2, text_top, 2, width_per - 2 ) elif num_of_boxes == 3: # middle top width_per = 95 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=40 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='middle', width_range=100, height_range=40, middle_center=30 ) specs_for_title = (0, 0, 20, 100) specs_for_text = ( 2.5, text_top, 2, width_per ) else: # right stack width_per = 40 text_top = _top_spec_for_text_at_bottom( text_block, width_per=width_per, per_from_bottom=(margin / HEIGHT) * 100, min_top=30 ) specs_for_boxes = _box_specs_gen( num_of_boxes, grouptype='rightgroup_v', width_range=60, margin=0, ) specs_for_title = (0, 3, 20, 40) specs_for_text = ( 2, text_top, 2, width_per - 2 ) # set text style attributes title_style_attr = {} text_style_attr = {'textAlign': text_textAlign} if text_font_color: text_style_attr['color'] = text_font_color if title_font_color: title_style_attr['color'] = title_font_color return (specs_for_boxes, specs_for_title, specs_for_text, bkgd_color, title_style_attr, text_style_attr, code_theme) def _url_parens_contained(url_name, line): return line.startswith(url_name + '(') and line.endswith(')') class Presentation(dict): """ The Presentation class for creating spectacle-presentations. The Presentations API is a means for creating JSON blobs which are then converted Spectacle Presentations. To use the API you only need to define a block string and define your slides using markdown. Then you can upload your presentation to the Plotly Server. Rules for your presentation string: - use '---' to denote a slide break. - headers work as per usual, where if '#' is used before a line of text then it is interpretted as a header. Only the first header in a slide is displayed on the slide. There are only 3 heading sizes: #, ## and ###. 4 or more hashes will be interpretted as ###. - you can set the type of slide transition you want by writing a line that starts with 'transition: ' before your first header line in the slide, and write the types of transition you want after. Your transition to choose from are 'slide', 'zoom', 'fade' and 'spin'. - to insert a Plotly chart into your slide, write a line that has the form Plotly(url) with your url pointing to your chart. Note that it is STRONGLY advised that your chart has fig['layout']['autosize'] = True. - to insert an image from the web, write a line with the form Image(url) - to insert a block of text, begin with a line that denotes the code envoronment '```lang' where lang is a valid programming language. To find the valid languages run:\n 'plotly.presentation_objs.presentation_objs.VALID_LANGUAGES'\n To end the code block environment, write a single '```' line. All Plotly(url) and Image(url) lines will NOT be interpretted as a Plotly or Image url if they are in the code block. :param (str) markdown_string: the block string that denotes the slides, slide properties, and images to be placed in the presentation. If 'markdown_string' is set to 'None', the JSON for a presentation with one empty slide will be created. :param (str) style: the theme that the presentation will take on. The themes that are available now are 'martik' and 'moods'. Default = 'moods'. :param (bool) imgStretch: if set to False, all images in the presentation will not have heights and widths that will not exceed the parent container they belong to. In other words, images will keep their original aspect ratios. Default = True. For examples see the documentation:\n https://plot.ly/python/presentations-api/ """ def __init__(self, markdown_string=None, style='moods', imgStretch=True): self['presentation'] = { 'slides': [], 'slidePreviews': [None for _ in range(496)], 'version': '0.1.3', 'paragraphStyles': paragraph_styles } if markdown_string: if style not in PRES_THEMES: raise exceptions.PlotlyError( "Your presentation style must be {}".format( list_of_options(PRES_THEMES, conj='or', period=True) ) ) self._markdown_to_presentation(markdown_string, style, imgStretch) else: self._add_empty_slide() def _markdown_to_presentation(self, markdown_string, style, imgStretch): list_of_slides = _list_of_slides(markdown_string) for slide_num, slide in enumerate(list_of_slides): lines_in_slide = slide.split('\n') title_lines = [] # validate blocks of code if slide.count('```') % 2 != 0: raise exceptions.PlotlyError(CODE_ENV_ERROR) # find code blocks code_indices = [] code_blocks = [] wdw_size = len('```') for j in range(len(slide)): if slide[j:j+wdw_size] == '```': code_indices.append(j) for k in range(int(len(code_indices) / 2)): code_blocks.append( slide[code_indices[2 * k]:code_indices[(2 * k) + 1]] ) lang_and_code_tuples = [] for code_block in code_blocks: # validate code blocks code_by_lines = code_block.split('\n') language = _remove_extra_whitespace_from_line( code_by_lines[0][3:] ).lower() if language == '' or language not in VALID_LANGUAGES: raise exceptions.PlotlyError( "The language of your code block should be " "clearly indicated after the first ``` that " "begins the code block. The valid languages to " "choose from are" + list_of_options( VALID_LANGUAGES ) ) lang_and_code_tuples.append( (language, '\n'.join(code_by_lines[1:])) ) # collect text, code and urls title_lines = [] url_lines = [] text_lines = [] inCode = False for line in lines_in_slide: # inCode handling if line[:3] == '```' and len(line) > 3: inCode = True if line == '```': inCode = False if not inCode and line != '```': if len(line) > 0 and line[0] == '#': title_lines.append(line) elif (_url_parens_contained('Plotly', line) or _url_parens_contained('Image', line)): if (line.startswith('Plotly(') and get_config()['plotly_domain'] not in line): raise exceptions.PlotlyError( "You are attempting to insert a Plotly Chart " "in your slide but your url does not have " "your plotly domain '{}' in it.".format( get_config()['plotly_domain'] ) ) url_lines.append(line) else: # find and set transition properties trans = 'transition:' if line.startswith(trans) and title_lines == []: slide_trans = line[len(trans):] slide_trans = _remove_extra_whitespace_from_line( slide_trans ) slide_transition_list = [] for key in VALID_TRANSITIONS: if key in slide_trans: slide_transition_list.append(key) if slide_transition_list == []: slide_transition_list.append('slide') self._set_transition( slide_transition_list, slide_num ) else: text_lines.append(line) # make text block for i in range(2): try: while text_lines[-i] == '': text_lines.pop(-i) except IndexError: pass text_block = '\n'.join(text_lines) num_of_boxes = len(url_lines) + len(lang_and_code_tuples) (specs_for_boxes, specs_for_title, specs_for_text, bkgd_color, title_style_attr, text_style_attr, code_theme) = _return_layout_specs( num_of_boxes, url_lines, title_lines, text_block, code_blocks, slide_num, style ) # background color self._color_background(bkgd_color, slide_num) # insert title, text, code, and images if len(title_lines) > 0: # clean titles title = title_lines[0] num_hashes = 0 while title[0] == '#': title = title[1:] num_hashes += 1 title = _remove_extra_whitespace_from_line(title) self._insert( box='Text', text_or_url=title, left=specs_for_title[0], top=specs_for_title[1], height=specs_for_title[2], width=specs_for_title[3], slide=slide_num, style_attr=title_style_attr, paragraphStyle='Heading 1'.format( min(num_hashes, 3) ) ) # text if len(text_lines) > 0: self._insert( box='Text', text_or_url=text_block, left=specs_for_text[0], top=specs_for_text[1], height=specs_for_text[2], width=specs_for_text[3], slide=slide_num, style_attr=text_style_attr, paragraphStyle='Body' ) url_and_code_blocks = list(url_lines + lang_and_code_tuples) for k, specs in enumerate(specs_for_boxes): url_or_code = url_and_code_blocks[k] if isinstance(url_or_code, tuple): # code language = url_or_code[0] code = url_or_code[1] box_name = 'CodePane' # code style props_attr = {} props_attr['language'] = language props_attr['theme'] = code_theme self._insert(box=box_name, text_or_url=code, left=specs[0], top=specs[1], height=specs[2], width=specs[3], slide=slide_num, props_attr=props_attr) else: # url if get_config()['plotly_domain'] in url_or_code: box_name = 'Plotly' else: box_name = 'Image' url = url_or_code[len(box_name) + 1: -1] self._insert(box=box_name, text_or_url=url, left=specs[0], top=specs[1], height=specs[2], width=specs[3], slide=slide_num) if not imgStretch: for s, slide in enumerate(self['presentation']['slides']): for c, child in enumerate(slide['children']): if child['type'] in ['Image', 'Plotly']: deep_child = child['props']['style'] width = deep_child['width'] height = deep_child['height'] if width >= height: deep_child['max-width'] = deep_child.pop('width') else: deep_child['max-height'] = deep_child.pop('height') def _add_empty_slide(self): self['presentation']['slides'].append( _empty_slide(['slide'], _generate_id(9)) ) def _add_missing_slides(self, slide): # add slides if desired slide number isn't in the presentation try: self['presentation']['slides'][slide]['children'] except IndexError: num_of_slides = len(self['presentation']['slides']) for _ in range(slide - num_of_slides + 1): self._add_empty_slide() def _insert(self, box, text_or_url, left, top, height, width, slide=0, props_attr={}, style_attr={}, paragraphStyle=None): self._add_missing_slides(slide) left, top, height, width = _return_box_position(left, top, height, width) new_id = _generate_id(9) child = _box(box, text_or_url, left, top, height, width, new_id, props_attr, style_attr, paragraphStyle) self['presentation']['slides'][slide]['children'].append(child) def _color_background(self, color, slide): self._add_missing_slides(slide) loc = self['presentation']['slides'][slide] loc['props']['style']['backgroundColor'] = color def _background_image(self, url, slide, bkrd_image_dict): self._add_missing_slides(slide) loc = self['presentation']['slides'][slide]['props'] # default settings size = 'stretch' repeat = 'no-repeat' if 'background-size:' in bkrd_image_dict: size = bkrd_image_dict['background-size:'] if 'background-repeat:' in bkrd_image_dict: repeat = bkrd_image_dict['background-repeat:'] if size == 'stretch': backgroundSize = '100% 100%' elif size == 'original': backgroundSize = 'auto' elif size == 'contain': backgroundSize = 'contain' elif size == 'cover': backgroundSize = 'cover' style = { 'backgroundImage': 'url({})'.format(url), 'backgroundPosition': 'center center', 'backgroundRepeat': repeat, 'backgroundSize': backgroundSize } for item in style.items(): loc['style'].setdefault(item[0], item[1]) loc['backgroundImageSrc'] = url loc['backgroundImageName'] = None def _set_transition(self, transition, slide): self._add_missing_slides(slide) loc = self['presentation']['slides'][slide]['props'] loc['transition'] = transition plotly-2.2.3+dfsg.orig/plotly/presentation_objs/__init__.py0000644000175000017500000000021113174436015023431 0ustar noahfxnoahfx""" presentation_objs A wrapper for the spectacle-presentations endpoint. =========== """ from . presentation_objs import Presentation plotly-2.2.3+dfsg.orig/plotly/dashboard_objs/0000755000175000017500000000000013211605515020535 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/dashboard_objs/dashboard_objs.py0000644000175000017500000004476013104403274024065 0ustar noahfxnoahfx""" dashboard_objs ========== A module for creating and manipulating dashboard content. You can create a Dashboard object, insert boxes, swap boxes, remove a box and get an HTML preview of the Dashboard. ``` """ import pprint from plotly import exceptions, optional_imports from plotly.utils import node_generator IPython = optional_imports.get_module('IPython') # default HTML parameters MASTER_WIDTH = 400 MASTER_HEIGHT = 400 FONT_SIZE = 10 ID_NOT_VALID_MESSAGE = ( "Your box_id must be a number in your dashboard. To view a " "representation of your dashboard run get_preview()." ) def _empty_box(): empty_box = { 'type': 'box', 'boxType': 'empty' } return empty_box def _box(fileId='', shareKey=None, title=''): box = { 'type': 'box', 'boxType': 'plot', 'fileId': fileId, 'shareKey': shareKey, 'title': title } return box def _container(box_1=None, box_2=None, size=MASTER_HEIGHT, sizeUnit='px', direction='vertical'): if box_1 is None: box_1 = _empty_box() if box_2 is None: box_2 = _empty_box() container = { 'type': 'split', 'size': size, 'sizeUnit': sizeUnit, 'direction': direction, 'first': box_1, 'second': box_2 } return container dashboard_html = (""" """.format(width=MASTER_WIDTH, height=MASTER_HEIGHT)) def _draw_line_through_box(dashboard_html, top_left_x, top_left_y, box_w, box_h, direction='vertical'): is_horizontal = (direction == 'horizontal') if is_horizontal: new_top_left_x = top_left_x + box_w / 2 new_top_left_y = top_left_y new_box_w = 1 new_box_h = box_h else: new_top_left_x = top_left_x new_top_left_y = top_left_y + box_h / 2 new_box_w = box_w new_box_h = 1 html_box = """ context.beginPath(); context.rect({top_left_x}, {top_left_y}, {box_w}, {box_h}); context.lineWidth = 1; context.strokeStyle = 'black'; context.stroke(); """.format(top_left_x=new_top_left_x, top_left_y=new_top_left_y, box_w=new_box_w, box_h=new_box_h) index_for_new_box = dashboard_html.find('') - 1 dashboard_html = (dashboard_html[:index_for_new_box] + html_box + dashboard_html[index_for_new_box:]) return dashboard_html def _add_html_text(dashboard_html, text, top_left_x, top_left_y, box_w, box_h): html_text = """ context.font = '{font_size}pt Times New Roman'; context.textAlign = 'center'; context.fillText({text}, {top_left_x} + 0.5*{box_w}, {top_left_y} + 0.5*{box_h}); """.format(text=text, top_left_x=top_left_x, top_left_y=top_left_y, box_w=box_w, box_h=box_h, font_size=FONT_SIZE) index_to_add_text = dashboard_html.find('') - 1 dashboard_html = (dashboard_html[:index_to_add_text] + html_text + dashboard_html[index_to_add_text:]) return dashboard_html class Dashboard(dict): """ Dashboard class for creating interactive dashboard objects. Dashboards are dicts that contain boxes which hold plot information. These boxes can be arranged in various ways. The most basic form of a box is: ``` { 'type': 'box', 'boxType': 'plot' } ``` where 'fileId' can be set to the 'username:#' of your plot. The other parameters a box takes are `shareKey` (default is None) and `title` (default is ''). `.get_preview()` should be called quite regularly to get an HTML representation of the dashboard in which the boxes in the HTML are labelled with on-the-fly-generated numbers or box ids which change after each modification to the dashboard. `.get_box()` returns the box located in the dashboard by calling its box id as displayed via `.get_preview()`. Example: Create a simple Dashboard object ``` import plotly.dashboard_objs as dashboard box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 1' } box_2 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 2' } box_3 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 3' } my_dboard = dashboard.Dashboard() my_dboard.insert(box_1) # my_dboard.get_preview() my_dboard.insert(box_2, 'above', 1) # my_dboard.get_preview() my_dboard.insert(box_3, 'left', 2) # my_dboard.get_preview() my_dboard.swap(1, 2) # my_dboard.get_preview() my_dboard.remove(1) # my_dboard.get_preview() ``` """ def __init__(self, content=None): if content is None: content = {} if not content: self['layout'] = None self['version'] = 2 self['settings'] = {} else: self['layout'] = content['layout'] self['version'] = content['version'] self['settings'] = content['settings'] self._set_container_sizes() def _compute_box_ids(self): box_ids_to_path = {} all_nodes = list(node_generator(self['layout'])) for node in all_nodes: if (node[1] != () and node[0]['type'] == 'box' and node[0]['boxType'] != 'empty'): try: max_id = max(box_ids_to_path.keys()) except ValueError: max_id = 0 box_ids_to_path[max_id + 1] = node[1] return box_ids_to_path def _insert(self, box_or_container, path): if any(first_second not in ['first', 'second'] for first_second in path): raise exceptions.PlotlyError( "Invalid path. Your 'path' list must only contain " "the strings 'first' and 'second'." ) if 'first' in self['layout']: loc_in_dashboard = self['layout'] for index, first_second in enumerate(path): if index != len(path) - 1: loc_in_dashboard = loc_in_dashboard[first_second] else: loc_in_dashboard[first_second] = box_or_container else: self['layout'] = box_or_container def _make_all_nodes_and_paths(self): all_nodes = list(node_generator(self['layout'])) # remove path 'second' as it's always an empty box all_paths = [] for node in all_nodes: all_paths.append(node[1]) path_second = ('second',) if path_second in all_paths: all_paths.remove(path_second) return all_nodes, all_paths def _set_container_sizes(self): if self['layout'] is None: return all_nodes, all_paths = self._make_all_nodes_and_paths() # set dashboard_height proportional to max_path_len max_path_len = max(len(path) for path in all_paths) dashboard_height = 500 + 250 * max_path_len self['layout']['size'] = dashboard_height self['layout']['sizeUnit'] = 'px' for path in all_paths: if len(path) != 0: if self._path_to_box(path)['type'] == 'split': self._path_to_box(path)['size'] = 50 self._path_to_box(path)['sizeUnit'] = '%' def _path_to_box(self, path): loc_in_dashboard = self['layout'] for first_second in path: loc_in_dashboard = loc_in_dashboard[first_second] return loc_in_dashboard def get_box(self, box_id): """Returns box from box_id number.""" box_ids_to_path = self._compute_box_ids() loc_in_dashboard = self['layout'] if box_id not in box_ids_to_path.keys(): raise exceptions.PlotlyError(ID_NOT_VALID_MESSAGE) for first_second in box_ids_to_path[box_id]: loc_in_dashboard = loc_in_dashboard[first_second] return loc_in_dashboard def get_preview(self): """ Returns JSON or HTML respresentation of the dashboard. If IPython is not imported, returns a pretty print of the dashboard dict. Otherwise, returns an IPython.core.display.HTML display of the dashboard. The algorithm used to build the HTML preview involves going through the paths of the node generator of the dashboard. The paths of the dashboard are sequenced through from shorter to longer and whether it's a box or container that lies at the end of the path determines the action. If it's a container, draw a line in the figure to divide the current box into two and store the specs of the resulting two boxes. If the path points to a terminal box (often containing a plot), then draw the box id in the center of the box. It's important to note that these box ids are generated on-the-fly and they do not necessarily stay assigned to the boxes they were once assigned to. """ if IPython is None: pprint.pprint(self) return elif self['layout'] is None: return IPython.display.HTML(dashboard_html) x = 0 y = 0 box_w = MASTER_WIDTH box_h = MASTER_HEIGHT html_figure = dashboard_html box_ids_to_path = self._compute_box_ids() # used to store info about box dimensions path_to_box_specs = {} first_box_specs = { 'top_left_x': x, 'top_left_y': y, 'box_w': box_w, 'box_h': box_h } # uses tuples to store paths as for hashable keys path_to_box_specs[('first',)] = first_box_specs # generate all paths all_nodes, all_paths = self._make_all_nodes_and_paths() max_path_len = max(len(path) for path in all_paths) for path_len in range(1, max_path_len + 1): for path in [path for path in all_paths if len(path) == path_len]: current_box_specs = path_to_box_specs[path] if self._path_to_box(path)['type'] == 'split': html_figure = _draw_line_through_box( html_figure, current_box_specs['top_left_x'], current_box_specs['top_left_y'], current_box_specs['box_w'], current_box_specs['box_h'], direction=self._path_to_box(path)['direction'] ) # determine the specs for resulting two boxes from split is_horizontal = ( self._path_to_box(path)['direction'] == 'horizontal' ) x = current_box_specs['top_left_x'] y = current_box_specs['top_left_y'] box_w = current_box_specs['box_w'] box_h = current_box_specs['box_h'] if is_horizontal: new_box_w = box_w / 2 new_box_h = box_h new_top_left_x = x + box_w / 2 new_top_left_y = y else: new_box_w = box_w new_box_h = box_h / 2 new_top_left_x = x new_top_left_y = y + box_h / 2 box_1_specs = { 'top_left_x': x, 'top_left_y': y, 'box_w': new_box_w, 'box_h': new_box_h } box_2_specs = { 'top_left_x': new_top_left_x, 'top_left_y': new_top_left_y, 'box_w': new_box_w, 'box_h': new_box_h } path_to_box_specs[path + ('first',)] = box_1_specs path_to_box_specs[path + ('second',)] = box_2_specs elif self._path_to_box(path)['type'] == 'box': for box_id in box_ids_to_path: if box_ids_to_path[box_id] == path: number = box_id html_figure = _add_html_text( html_figure, number, path_to_box_specs[path]['top_left_x'], path_to_box_specs[path]['top_left_y'], path_to_box_specs[path]['box_w'], path_to_box_specs[path]['box_h'], ) # display HTML representation return IPython.display.HTML(html_figure) def insert(self, box, side='above', box_id=None): """ Insert a box into your dashboard layout. :param (dict) box: the box you are inserting into the dashboard. :param (str) side: specifies where your new box is going to be placed relative to the given 'box_id'. Valid values are 'above', 'below', 'left', and 'right'. :param (int) box_id: the box id which is used as the reference box for the insertion of the box. Example: ``` import plotly.dashboard_objs as dashboard box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 1' } my_dboard = dashboard.Dashboard() my_dboard.insert(box_1) my_dboard.insert(box_1, 'left', 1) my_dboard.insert(box_1, 'below', 2) my_dboard.insert(box_1, 'right', 3) my_dboard.insert(box_1, 'above', 4) my_dboard.get_preview() ``` """ box_ids_to_path = self._compute_box_ids() # doesn't need box_id or side specified for first box if self['layout'] is None: self['layout'] = _container(box, _empty_box()) else: if box_id is None: raise exceptions.PlotlyError( "Make sure the box_id is specfied if there is at least " "one box in your dashboard." ) if box_id not in box_ids_to_path: raise exceptions.PlotlyError(ID_NOT_VALID_MESSAGE) if side == 'above': old_box = self.get_box(box_id) self._insert( _container(box, old_box, direction='vertical'), box_ids_to_path[box_id] ) elif side == 'below': old_box = self.get_box(box_id) self._insert( _container(old_box, box, direction='vertical'), box_ids_to_path[box_id] ) elif side == 'left': old_box = self.get_box(box_id) self._insert( _container(box, old_box, direction='horizontal'), box_ids_to_path[box_id] ) elif side == 'right': old_box = self.get_box(box_id) self._insert( _container(old_box, box, direction='horizontal'), box_ids_to_path[box_id] ) else: raise exceptions.PlotlyError( "If there is at least one box in your dashboard, you " "must specify a valid side value. You must choose from " "'above', 'below', 'left', and 'right'." ) self._set_container_sizes() def remove(self, box_id): """ Remove a box from the dashboard by its box_id. Example: ``` import plotly.dashboard_objs as dashboard box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 1' } my_dboard = dashboard.Dashboard() my_dboard.insert(box_1) my_dboard.remove(1) my_dboard.get_preview() ``` """ box_ids_to_path = self._compute_box_ids() if box_id not in box_ids_to_path: raise exceptions.PlotlyError(ID_NOT_VALID_MESSAGE) path = box_ids_to_path[box_id] if path != ('first',): container_for_box_id = self._path_to_box(path[:-1]) if path[-1] == 'first': adjacent_path = 'second' elif path[-1] == 'second': adjacent_path = 'first' adjacent_box = container_for_box_id[adjacent_path] self._insert(adjacent_box, path[:-1]) else: self['layout'] = None self._set_container_sizes() def swap(self, box_id_1, box_id_2): """ Swap two boxes with their specified ids. Example: ``` import plotly.dashboard_objs as dashboard box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:first#', 'title': 'first box' } box_2 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:second#', 'title': 'second box' } my_dboard = dashboard.Dashboard() my_dboard.insert(box_1) my_dboard.insert(box_2, 'above', 1) # check box at box id 1 box_at_1 = my_dboard.get_box(1) print(box_at_1) my_dboard.swap(1, 2) box_after_swap = my_dboard.get_box(1) print(box_after_swap) ``` """ box_ids_to_path = self._compute_box_ids() box_1 = self.get_box(box_id_1) box_2 = self.get_box(box_id_2) box_1_path = box_ids_to_path[box_id_1] box_2_path = box_ids_to_path[box_id_2] for pairs in [(box_1_path, box_2), (box_2_path, box_1)]: loc_in_dashboard = self['layout'] for first_second in pairs[0][:-1]: loc_in_dashboard = loc_in_dashboard[first_second] loc_in_dashboard[pairs[0][-1]] = pairs[1] self._set_container_sizes() plotly-2.2.3+dfsg.orig/plotly/dashboard_objs/__init__.py0000644000175000017500000000336013104403274022647 0ustar noahfxnoahfx""" dashboard_objs ========== A module for creating and manipulating dashboard content. You can create a Dashboard object, insert boxes, swap boxes, remove a box and get an HTML preview of the Dashboard. The current workflow for making and manipulating dashboard follows: 1) Create a Dashboard 2) Modify the Dashboard (insert, swap, remove, etc) 3) Preview the Dashboard (run `.get_preview()`) 4) Repeat steps 2) and 3) as long as desired The basic box object that your insert into a dashboard is just a `dict`. The minimal dict for a box is: ``` { 'type': 'box', 'boxType': 'plot' } ``` where 'fileId' can be set to the 'username:#' of your plot. The other parameters a box takes are `shareKey` (default is None) and `title` (default is ''). You will need to use the `.get_preview()` method quite regularly as this will return an HTML representation of the dashboard in which the boxes in the HTML are labelled with on-the-fly-generated numbers which change after each modification to the dashboard. Example: Create a simple Dashboard object ``` import plotly.dashboard_objs as dashboard box_1 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 1' } box_2 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 2' } box_3 = { 'type': 'box', 'boxType': 'plot', 'fileId': 'username:some#', 'title': 'box 3' } my_dboard = dashboard.Dashboard() my_dboard.insert(box_1) # my_dboard.get_preview() my_dboard.insert(box_2, 'above', 1) # my_dboard.get_preview() my_dboard.insert(box_3, 'left', 2) # my_dboard.get_preview() my_dboard.swap(1, 2) # my_dboard.get_preview() my_dboard.remove(1) # my_dboard.get_preview() ``` """ from . dashboard_objs import Dashboard plotly-2.2.3+dfsg.orig/plotly/grid_objs/0000755000175000017500000000000013211605515017533 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/grid_objs/grid_objs.py0000644000175000017500000002412313104403274022050 0ustar noahfxnoahfx""" grid_objs ========= """ from __future__ import absolute_import from collections import MutableSequence from requests.compat import json as _json from plotly import exceptions, optional_imports, utils pd = optional_imports.get_module('pandas') __all__ = None class Column(object): """ Columns make up Plotly Grids and can be the source of data for Plotly Graphs. They have a name and an array of data. They can be uploaded to Plotly with the `plotly.plotly.grid_ops` class. Usage example 1: Upload a set of columns as a grid to Plotly ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') ``` Usage example 2: Make a graph based with data that is sourced from a newly uploaded Plotly columns ``` import plotly.plotly as py from plotly.grid_objs import Grid, Column from plotly.graph_objs import Scatter # Upload a grid column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') # Build a Plotly graph object sourced from the # grid's columns trace = Scatter(xsrc=grid[0], ysrc=grid[1]) py.plot([trace], filename='graph from grid') ``` """ def __init__(self, data, name): """ Initialize a Plotly column with `data` and `name`. `data` is an array of strings, numbers, or dates. `name` is the name of the column as it will apppear in the Plotly grid. Names must be unique to a grid. """ # TODO: data type checking self.data = data # TODO: name type checking self.name = name self.id = '' def __str__(self): max_chars = 10 jdata = _json.dumps(self.data, cls=utils.PlotlyJSONEncoder) if len(jdata) > max_chars: data_string = jdata[:max_chars] + "...]" else: data_string = jdata string = '' return string.format(name=self.name, data=data_string, id=self.id) def __repr__(self): return 'Column("{0}", {1})'.format(self.data, self.name) def to_plotly_json(self): return {'name': self.name, 'data': self.data} class Grid(MutableSequence): """ Grid is Plotly's Python representation of Plotly Grids. Plotly Grids are tabular data made up of columns. They can be uploaded, appended to, and can source the data for Plotly graphs. A plotly.grid_objs.Grid object is essentially a list. Usage example 1: Upload a set of columns as a grid to Plotly ``` from plotly.grid_objs import Grid, Column import plotly.plotly as py column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') ``` Usage example 2: Make a graph based with data that is sourced from a newly uploaded Plotly columns ``` import plotly.plotly as py from plotly.grid_objs import Grid, Column from plotly.graph_objs import Scatter # Upload a grid column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) py.grid_ops.upload(grid, 'time vs voltage') # Build a Plotly graph object sourced from the # grid's columns trace = Scatter(xsrc=grid[0], ysrc=grid[1]) py.plot([trace], filename='graph from grid') ``` """ def __init__(self, columns_or_json, fid=None): """ Initialize a grid with an iterable of `plotly.grid_objs.Column` objects or a json/dict describing a grid. See second usage example below for the necessary structure of the dict. :param (str|bool) fid: should not be accessible to users. Default is 'None' but if a grid is retrieved via `py.get_grid()` then the retrieved grid response will contain the fid which will be necessary to set `self.id` and `self._columns.id` below. Example from iterable of columns: ``` column_1 = Column([1, 2, 3], 'time') column_2 = Column([4, 2, 5], 'voltage') grid = Grid([column_1, column_2]) ``` Example from json grid ``` grid_json = { 'cols': { 'time': {'data': [1, 2, 3], 'order': 0, 'uid': '4cd7fc'}, 'voltage': {'data': [4, 2, 5], 'order': 1, 'uid': u'2744be'} } } grid = Grid(grid_json) ``` """ # TODO: verify that columns are actually columns if pd and isinstance(columns_or_json, pd.DataFrame): duplicate_name = utils.get_first_duplicate(columns_or_json.columns) if duplicate_name: err = exceptions.NON_UNIQUE_COLUMN_MESSAGE.format(duplicate_name) raise exceptions.InputError(err) # create columns from dataframe all_columns = [] for name in columns_or_json.columns: all_columns.append(Column(columns_or_json[name].tolist(), name)) self._columns = all_columns self.id = '' elif isinstance(columns_or_json, dict): # check that fid is entered if fid is None: raise exceptions.PlotlyError( "If you are manually converting a raw json/dict grid " "into a Grid instance, you must ensure that 'fid' is " "set to your file ID. This looks like 'username:187'." ) self.id = fid # check if 'cols' is a root key if 'cols' not in columns_or_json: raise exceptions.PlotlyError( "'cols' must be a root key in your json grid." ) # check if 'data', 'order' and 'uid' are not in columns grid_col_keys = ['data', 'order', 'uid'] for column_name in columns_or_json['cols']: for key in grid_col_keys: if key not in columns_or_json['cols'][column_name]: raise exceptions.PlotlyError( "Each column name of your dictionary must have " "'data', 'order' and 'uid' as keys." ) # collect and sort all orders in case orders do not start # at zero or there are jump discontinuities between them all_orders = [] for column_name in columns_or_json['cols'].keys(): all_orders.append(columns_or_json['cols'][column_name]['order']) all_orders.sort() # put columns in order in a list ordered_columns = [] for order in all_orders: for column_name in columns_or_json['cols'].keys(): if columns_or_json['cols'][column_name]['order'] == order: break ordered_columns.append(Column( columns_or_json['cols'][column_name]['data'], column_name) ) self._columns = ordered_columns # fill in column_ids for column in self: column.id = self.id + ':' + columns_or_json['cols'][column.name]['uid'] else: column_names = [column.name for column in columns_or_json] duplicate_name = utils.get_first_duplicate(column_names) if duplicate_name: err = exceptions.NON_UNIQUE_COLUMN_MESSAGE.format(duplicate_name) raise exceptions.InputError(err) self._columns = list(columns_or_json) self.id = '' def __repr__(self): return self._columns.__repr__() def __getitem__(self, index): return self._columns[index] def __setitem__(self, index, column): self._validate_insertion(column) return self._columns.__setitem__(index, column) def __delitem__(self, index): del self._columns[index] def __len__(self): return len(self._columns) def insert(self, index, column): self._validate_insertion(column) self._columns.insert(index, column) def _validate_insertion(self, column): """ Raise an error if we're gonna add a duplicate column name """ existing_column_names = [col.name for col in self._columns] if column.name in existing_column_names: err = exceptions.NON_UNIQUE_COLUMN_MESSAGE.format(column.name) raise exceptions.InputError(err) def _to_plotly_grid_json(self): grid_json = {'cols': {}} for column_index, column in enumerate(self): grid_json['cols'][column.name] = { 'data': column.data, 'order': column_index } return grid_json def get_column(self, column_name): """ Return the first column with name `column_name`. If no column with `column_name` exists in this grid, return None. """ for column in self._columns: if column.name == column_name: return column def get_column_reference(self, column_name): """ Returns the column reference of given column in the grid by its name. Raises an error if the column name is not in the grid. Otherwise, returns the fid:uid pair, which may be the empty string. """ column_id = None for column in self._columns: if column.name == column_name: column_id = column.id break if column_id is None: col_names = [] for column in self._columns: col_names.append(column.name) raise exceptions.PlotlyError( "Whoops, that column name doesn't match any of the column " "names in your grid. You must pick from {cols}".format(cols=col_names) ) return column_id plotly-2.2.3+dfsg.orig/plotly/grid_objs/__init__.py0000644000175000017500000000017213104403274021643 0ustar noahfxnoahfx"""" grid_objs ========= """ from __future__ import absolute_import from plotly.grid_objs.grid_objs import Grid, Column plotly-2.2.3+dfsg.orig/plotly/matplotlylib/0000755000175000017500000000000013211605515020305 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/0000755000175000017500000000000013211605515022666 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/utils.py0000644000175000017500000002617013104403274024405 0ustar noahfxnoahfx""" Utility Routines for Working with Matplotlib Objects ==================================================== """ import itertools import io import base64 import numpy as np import warnings import matplotlib from matplotlib.colors import colorConverter from matplotlib.path import Path from matplotlib.markers import MarkerStyle from matplotlib.transforms import Affine2D from matplotlib import ticker def color_to_hex(color): """Convert matplotlib color code to hex color code""" if color is None or colorConverter.to_rgba(color)[3] == 0: return 'none' else: rgb = colorConverter.to_rgb(color) return '#{0:02X}{1:02X}{2:02X}'.format(*(int(255 * c) for c in rgb)) def many_to_one(input_dict): """Convert a many-to-one mapping to a one-to-one mapping""" return dict((key, val) for keys, val in input_dict.items() for key in keys) LINESTYLES = many_to_one({('solid', '-', (None, None)): "10,0", ('dashed', '--'): "6,6", ('dotted', ':'): "2,2", ('dashdot', '-.'): "4,4,2,4", ('', ' ', 'None', 'none'): "none"}) def get_dasharray(obj, i=None): """Get an SVG dash array for the given matplotlib linestyle Parameters ---------- obj : matplotlib object The matplotlib line or path object, which must have a get_linestyle() method which returns a valid matplotlib line code i : integer (optional) Returns ------- dasharray : string The HTML/SVG dasharray code associated with the object. """ if obj.__dict__.get('_dashSeq', None) is not None: return ','.join(map(str, obj._dashSeq)) else: ls = obj.get_linestyle() if i is not None: ls = ls[i] dasharray = LINESTYLES.get(ls, None) if dasharray is None: warnings.warn("dash style '{0}' not understood: " "defaulting to solid.".format(ls)) dasharray = LINESTYLES['-'] return dasharray PATH_DICT = {Path.LINETO: 'L', Path.MOVETO: 'M', Path.CURVE3: 'S', Path.CURVE4: 'C', Path.CLOSEPOLY: 'Z'} def SVG_path(path, transform=None, simplify=False): """Construct the vertices and SVG codes for the path Parameters ---------- path : matplotlib.Path object transform : matplotlib transform (optional) if specified, the path will be transformed before computing the output. Returns ------- vertices : array The shape (M, 2) array of vertices of the Path. Note that some Path codes require multiple vertices, so the length of these vertices may be longer than the list of path codes. path_codes : list A length N list of single-character path codes, N <= M. Each code is a single character, in ['L','M','S','C','Z']. See the standard SVG path specification for a description of these. """ if transform is not None: path = path.transformed(transform) vc_tuples = [(vertices if path_code != Path.CLOSEPOLY else [], PATH_DICT[path_code]) for (vertices, path_code) in path.iter_segments(simplify=simplify)] if not vc_tuples: # empty path is a special case return np.zeros((0, 2)), [] else: vertices, codes = zip(*vc_tuples) vertices = np.array(list(itertools.chain(*vertices))).reshape(-1, 2) return vertices, list(codes) def get_path_style(path, fill=True): """Get the style dictionary for matplotlib path objects""" style = {} style['alpha'] = path.get_alpha() if style['alpha'] is None: style['alpha'] = 1 style['edgecolor'] = color_to_hex(path.get_edgecolor()) if fill: style['facecolor'] = color_to_hex(path.get_facecolor()) else: style['facecolor'] = 'none' style['edgewidth'] = path.get_linewidth() style['dasharray'] = get_dasharray(path) style['zorder'] = path.get_zorder() return style def get_line_style(line): """Get the style dictionary for matplotlib line objects""" style = {} style['alpha'] = line.get_alpha() if style['alpha'] is None: style['alpha'] = 1 style['color'] = color_to_hex(line.get_color()) style['linewidth'] = line.get_linewidth() style['dasharray'] = get_dasharray(line) style['zorder'] = line.get_zorder() return style def get_marker_style(line): """Get the style dictionary for matplotlib marker objects""" style = {} style['alpha'] = line.get_alpha() if style['alpha'] is None: style['alpha'] = 1 style['facecolor'] = color_to_hex(line.get_markerfacecolor()) style['edgecolor'] = color_to_hex(line.get_markeredgecolor()) style['edgewidth'] = line.get_markeredgewidth() style['marker'] = line.get_marker() markerstyle = MarkerStyle(line.get_marker()) markersize = line.get_markersize() markertransform = (markerstyle.get_transform() + Affine2D().scale(markersize, -markersize)) style['markerpath'] = SVG_path(markerstyle.get_path(), markertransform) style['markersize'] = markersize style['zorder'] = line.get_zorder() return style def get_text_style(text): """Return the text style dict for a text instance""" style = {} style['alpha'] = text.get_alpha() if style['alpha'] is None: style['alpha'] = 1 style['fontsize'] = text.get_size() style['color'] = color_to_hex(text.get_color()) style['halign'] = text.get_horizontalalignment() # left, center, right style['valign'] = text.get_verticalalignment() # baseline, center, top style['rotation'] = text.get_rotation() style['zorder'] = text.get_zorder() return style def get_axis_properties(axis): """Return the property dictionary for a matplotlib.Axis instance""" props = {} label1On = axis._major_tick_kw.get('label1On', True) if isinstance(axis, matplotlib.axis.XAxis): if label1On: props['position'] = "bottom" else: props['position'] = "top" elif isinstance(axis, matplotlib.axis.YAxis): if label1On: props['position'] = "left" else: props['position'] = "right" else: raise ValueError("{0} should be an Axis instance".format(axis)) # Use tick values if appropriate locator = axis.get_major_locator() props['nticks'] = len(locator()) if isinstance(locator, ticker.FixedLocator): props['tickvalues'] = list(locator()) else: props['tickvalues'] = None # Find tick formats formatter = axis.get_major_formatter() if isinstance(formatter, ticker.NullFormatter): props['tickformat'] = "" elif not any(label.get_visible() for label in axis.get_ticklabels()): props['tickformat'] = "" else: props['tickformat'] = None # Get axis scale props['scale'] = axis.get_scale() # Get major tick label size (assumes that's all we really care about!) labels = axis.get_ticklabels() if labels: props['fontsize'] = labels[0].get_fontsize() else: props['fontsize'] = None # Get associated grid props['grid'] = get_grid_style(axis) return props def get_grid_style(axis): gridlines = axis.get_gridlines() if axis._gridOnMajor and len(gridlines) > 0: color = color_to_hex(gridlines[0].get_color()) alpha = gridlines[0].get_alpha() dasharray = get_dasharray(gridlines[0]) return dict(gridOn=True, color=color, dasharray=dasharray, alpha=alpha) else: return {"gridOn":False} def get_figure_properties(fig): return {'figwidth': fig.get_figwidth(), 'figheight': fig.get_figheight(), 'dpi': fig.dpi} def get_axes_properties(ax): props = {'axesbg': color_to_hex(ax.patch.get_facecolor()), 'axesbgalpha': ax.patch.get_alpha(), 'bounds': ax.get_position().bounds, 'dynamic': ax.get_navigate(), 'axison': ax.axison, 'frame_on': ax.get_frame_on(), 'axes': [get_axis_properties(ax.xaxis), get_axis_properties(ax.yaxis)]} for axname in ['x', 'y']: axis = getattr(ax, axname + 'axis') domain = getattr(ax, 'get_{0}lim'.format(axname))() lim = domain if isinstance(axis.converter, matplotlib.dates.DateConverter): scale = 'date' try: import pandas as pd from pandas.tseries.converter import PeriodConverter except ImportError: pd = None if (pd is not None and isinstance(axis.converter, PeriodConverter)): _dates = [pd.Period(ordinal=int(d), freq=axis.freq) for d in domain] domain = [(d.year, d.month - 1, d.day, d.hour, d.minute, d.second, 0) for d in _dates] else: domain = [(d.year, d.month - 1, d.day, d.hour, d.minute, d.second, d.microsecond * 1E-3) for d in matplotlib.dates.num2date(domain)] else: scale = axis.get_scale() if scale not in ['date', 'linear', 'log']: raise ValueError("Unknown axis scale: " "{0}".format(axis[axname].get_scale())) props[axname + 'scale'] = scale props[axname + 'lim'] = lim props[axname + 'domain'] = domain return props def iter_all_children(obj, skipContainers=False): """ Returns an iterator over all childen and nested children using obj's get_children() method if skipContainers is true, only childless objects are returned. """ if hasattr(obj, 'get_children') and len(obj.get_children()) > 0: for child in obj.get_children(): if not skipContainers: yield child # could use `yield from` in python 3... for grandchild in iter_all_children(child, skipContainers): yield grandchild else: yield obj def get_legend_properties(ax, legend): handles, labels = ax.get_legend_handles_labels() visible = legend.get_visible() return {'handles': handles, 'labels': labels, 'visible': visible} def image_to_base64(image): """ Convert a matplotlib image to a base64 png representation Parameters ---------- image : matplotlib image object The image to be converted. Returns ------- image_base64 : string The UTF8-encoded base64 string representation of the png image. """ ax = image.axes binary_buffer = io.BytesIO() # image is saved in axes coordinates: we need to temporarily # set the correct limits to get the correct image lim = ax.axis() ax.axis(image.get_extent()) image.write_png(binary_buffer) ax.axis(lim) binary_buffer.seek(0) return base64.b64encode(binary_buffer.read()).decode('utf-8') plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/exporter.py0000644000175000017500000003001213104403274025103 0ustar noahfxnoahfx""" Matplotlib Exporter =================== This submodule contains tools for crawling a matplotlib figure and exporting relevant pieces to a renderer. """ import warnings import io from . import utils import matplotlib from matplotlib import transforms, collections class Exporter(object): """Matplotlib Exporter Parameters ---------- renderer : Renderer object The renderer object called by the exporter to create a figure visualization. See mplexporter.Renderer for information on the methods which should be defined within the renderer. close_mpl : bool If True (default), close the matplotlib figure as it is rendered. This is useful for when the exporter is used within the notebook, or with an interactive matplotlib backend. """ def __init__(self, renderer, close_mpl=True): self.close_mpl = close_mpl self.renderer = renderer def run(self, fig): """ Run the exporter on the given figure Parmeters --------- fig : matplotlib.Figure instance The figure to export """ # Calling savefig executes the draw() command, putting elements # in the correct place. fig.savefig(io.BytesIO(), format='png', dpi=fig.dpi) if self.close_mpl: import matplotlib.pyplot as plt plt.close(fig) self.crawl_fig(fig) @staticmethod def process_transform(transform, ax=None, data=None, return_trans=False, force_trans=None): """Process the transform and convert data to figure or data coordinates Parameters ---------- transform : matplotlib Transform object The transform applied to the data ax : matplotlib Axes object (optional) The axes the data is associated with data : ndarray (optional) The array of data to be transformed. return_trans : bool (optional) If true, return the final transform of the data force_trans : matplotlib.transform instance (optional) If supplied, first force the data to this transform Returns ------- code : string Code is either "data", "axes", "figure", or "display", indicating the type of coordinates output. transform : matplotlib transform the transform used to map input data to output data. Returned only if return_trans is True new_data : ndarray Data transformed to match the given coordinate code. Returned only if data is specified """ if isinstance(transform, transforms.BlendedGenericTransform): warnings.warn("Blended transforms not yet supported. " "Zoom behavior may not work as expected.") if force_trans is not None: if data is not None: data = (transform - force_trans).transform(data) transform = force_trans code = "display" if ax is not None: for (c, trans) in [("data", ax.transData), ("axes", ax.transAxes), ("figure", ax.figure.transFigure), ("display", transforms.IdentityTransform())]: if transform.contains_branch(trans): code, transform = (c, transform - trans) break if data is not None: if return_trans: return code, transform.transform(data), transform else: return code, transform.transform(data) else: if return_trans: return code, transform else: return code def crawl_fig(self, fig): """Crawl the figure and process all axes""" with self.renderer.draw_figure(fig=fig, props=utils.get_figure_properties(fig)): for ax in fig.axes: self.crawl_ax(ax) def crawl_ax(self, ax): """Crawl the axes and process all elements within""" with self.renderer.draw_axes(ax=ax, props=utils.get_axes_properties(ax)): for line in ax.lines: self.draw_line(ax, line) for text in ax.texts: self.draw_text(ax, text) for (text, ttp) in zip([ax.xaxis.label, ax.yaxis.label, ax.title], ["xlabel", "ylabel", "title"]): if(hasattr(text, 'get_text') and text.get_text()): self.draw_text(ax, text, force_trans=ax.transAxes, text_type=ttp) for artist in ax.artists: # TODO: process other artists if isinstance(artist, matplotlib.text.Text): self.draw_text(ax, artist) for patch in ax.patches: self.draw_patch(ax, patch) for collection in ax.collections: self.draw_collection(ax, collection) for image in ax.images: self.draw_image(ax, image) legend = ax.get_legend() if legend is not None: props = utils.get_legend_properties(ax, legend) with self.renderer.draw_legend(legend=legend, props=props): if props['visible']: self.crawl_legend(ax, legend) def crawl_legend(self, ax, legend): """ Recursively look through objects in legend children """ legendElements = list(utils.iter_all_children(legend._legend_box, skipContainers=True)) legendElements.append(legend.legendPatch) for child in legendElements: # force a large zorder so it appears on top child.set_zorder(1E6 + child.get_zorder()) try: # What kind of object... if isinstance(child, matplotlib.patches.Patch): self.draw_patch(ax, child, force_trans=ax.transAxes) elif isinstance(child, matplotlib.text.Text): if (child is not legend.get_children()[-1] and child.get_text() != 'None'): self.draw_text(ax, child, force_trans=ax.transAxes) elif isinstance(child, matplotlib.lines.Line2D): self.draw_line(ax, child, force_trans=ax.transAxes) elif isinstance(child, matplotlib.collections.Collection): self.draw_collection(ax, child, force_pathtrans=ax.transAxes) else: warnings.warn("Legend element %s not impemented" % child) except NotImplementedError: warnings.warn("Legend element %s not impemented" % child) def draw_line(self, ax, line, force_trans=None): """Process a matplotlib line and call renderer.draw_line""" coordinates, data = self.process_transform(line.get_transform(), ax, line.get_xydata(), force_trans=force_trans) linestyle = utils.get_line_style(line) if linestyle['dasharray'] in ['None', 'none', None]: linestyle = None markerstyle = utils.get_marker_style(line) if (markerstyle['marker'] in ['None', 'none', None] or markerstyle['markerpath'][0].size == 0): markerstyle = None label = line.get_label() if markerstyle or linestyle: self.renderer.draw_marked_line(data=data, coordinates=coordinates, linestyle=linestyle, markerstyle=markerstyle, label=label, mplobj=line) def draw_text(self, ax, text, force_trans=None, text_type=None): """Process a matplotlib text object and call renderer.draw_text""" content = text.get_text() if content: transform = text.get_transform() position = text.get_position() coords, position = self.process_transform(transform, ax, position, force_trans=force_trans) style = utils.get_text_style(text) self.renderer.draw_text(text=content, position=position, coordinates=coords, text_type=text_type, style=style, mplobj=text) def draw_patch(self, ax, patch, force_trans=None): """Process a matplotlib patch object and call renderer.draw_path""" vertices, pathcodes = utils.SVG_path(patch.get_path()) transform = patch.get_transform() coordinates, vertices = self.process_transform(transform, ax, vertices, force_trans=force_trans) linestyle = utils.get_path_style(patch, fill=patch.get_fill()) self.renderer.draw_path(data=vertices, coordinates=coordinates, pathcodes=pathcodes, style=linestyle, mplobj=patch) def draw_collection(self, ax, collection, force_pathtrans=None, force_offsettrans=None): """Process a matplotlib collection and call renderer.draw_collection""" (transform, transOffset, offsets, paths) = collection._prepare_points() offset_coords, offsets = self.process_transform( transOffset, ax, offsets, force_trans=force_offsettrans) path_coords = self.process_transform( transform, ax, force_trans=force_pathtrans) processed_paths = [utils.SVG_path(path) for path in paths] processed_paths = [(self.process_transform( transform, ax, path[0], force_trans=force_pathtrans)[1], path[1]) for path in processed_paths] path_transforms = collection.get_transforms() try: # matplotlib 1.3: path_transforms are transform objects. # Convert them to numpy arrays. path_transforms = [t.get_matrix() for t in path_transforms] except AttributeError: # matplotlib 1.4: path transforms are already numpy arrays. pass styles = {'linewidth': collection.get_linewidths(), 'facecolor': collection.get_facecolors(), 'edgecolor': collection.get_edgecolors(), 'alpha': collection._alpha, 'zorder': collection.get_zorder()} offset_dict = {"data": "before", "screen": "after"} offset_order = offset_dict[collection.get_offset_position()] self.renderer.draw_path_collection(paths=processed_paths, path_coordinates=path_coords, path_transforms=path_transforms, offsets=offsets, offset_coordinates=offset_coords, offset_order=offset_order, styles=styles, mplobj=collection) def draw_image(self, ax, image): """Process a matplotlib image object and call renderer.draw_image""" self.renderer.draw_image(imdata=utils.image_to_base64(image), extent=image.get_extent(), coordinates="data", style={"alpha": image.get_alpha(), "zorder": image.get_zorder()}, mplobj=image) plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/renderers/0000755000175000017500000000000013211605515024657 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/renderers/base.py0000644000175000017500000003402313104403274026144 0ustar noahfxnoahfximport warnings import itertools from contextlib import contextmanager import numpy as np from matplotlib import transforms from .. import utils from .. import _py3k_compat as py3k class Renderer(object): @staticmethod def ax_zoomable(ax): return bool(ax and ax.get_navigate()) @staticmethod def ax_has_xgrid(ax): return bool(ax and ax.xaxis._gridOnMajor and ax.yaxis.get_gridlines()) @staticmethod def ax_has_ygrid(ax): return bool(ax and ax.yaxis._gridOnMajor and ax.yaxis.get_gridlines()) @property def current_ax_zoomable(self): return self.ax_zoomable(self._current_ax) @property def current_ax_has_xgrid(self): return self.ax_has_xgrid(self._current_ax) @property def current_ax_has_ygrid(self): return self.ax_has_ygrid(self._current_ax) @contextmanager def draw_figure(self, fig, props): if hasattr(self, "_current_fig") and self._current_fig is not None: warnings.warn("figure embedded in figure: something is wrong") self._current_fig = fig self._fig_props = props self.open_figure(fig=fig, props=props) yield self.close_figure(fig=fig) self._current_fig = None self._fig_props = {} @contextmanager def draw_axes(self, ax, props): if hasattr(self, "_current_ax") and self._current_ax is not None: warnings.warn("axes embedded in axes: something is wrong") self._current_ax = ax self._ax_props = props self.open_axes(ax=ax, props=props) yield self.close_axes(ax=ax) self._current_ax = None self._ax_props = {} @contextmanager def draw_legend(self, legend, props): self._current_legend = legend self._legend_props = props self.open_legend(legend=legend, props=props) yield self.close_legend(legend=legend) self._current_legend = None self._legend_props = {} # Following are the functions which should be overloaded in subclasses def open_figure(self, fig, props): """ Begin commands for a particular figure. Parameters ---------- fig : matplotlib.Figure The Figure which will contain the ensuing axes and elements props : dictionary The dictionary of figure properties """ pass def close_figure(self, fig): """ Finish commands for a particular figure. Parameters ---------- fig : matplotlib.Figure The figure which is finished being drawn. """ pass def open_axes(self, ax, props): """ Begin commands for a particular axes. Parameters ---------- ax : matplotlib.Axes The Axes which will contain the ensuing axes and elements props : dictionary The dictionary of axes properties """ pass def close_axes(self, ax): """ Finish commands for a particular axes. Parameters ---------- ax : matplotlib.Axes The Axes which is finished being drawn. """ pass def open_legend(self, legend, props): """ Beging commands for a particular legend. Parameters ---------- legend : matplotlib.legend.Legend The Legend that will contain the ensuing elements props : dictionary The dictionary of legend properties """ pass def close_legend(self, legend): """ Finish commands for a particular legend. Parameters ---------- legend : matplotlib.legend.Legend The Legend which is finished being drawn """ pass def draw_marked_line(self, data, coordinates, linestyle, markerstyle, label, mplobj=None): """Draw a line that also has markers. If this isn't reimplemented by a renderer object, by default, it will make a call to BOTH draw_line and draw_markers when both markerstyle and linestyle are not None in the same Line2D object. """ if linestyle is not None: self.draw_line(data, coordinates, linestyle, label, mplobj) if markerstyle is not None: self.draw_markers(data, coordinates, markerstyle, label, mplobj) def draw_line(self, data, coordinates, style, label, mplobj=None): """ Draw a line. By default, draw the line via the draw_path() command. Some renderers might wish to override this and provide more fine-grained behavior. In matplotlib, lines are generally created via the plt.plot() command, though this command also can create marker collections. Parameters ---------- data : array_like A shape (N, 2) array of datapoints. coordinates : string A string code, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. style : dictionary a dictionary specifying the appearance of the line. mplobj : matplotlib object the matplotlib plot element which generated this line """ pathcodes = ['M'] + (data.shape[0] - 1) * ['L'] pathstyle = dict(facecolor='none', **style) pathstyle['edgecolor'] = pathstyle.pop('color') pathstyle['edgewidth'] = pathstyle.pop('linewidth') self.draw_path(data=data, coordinates=coordinates, pathcodes=pathcodes, style=pathstyle, mplobj=mplobj) @staticmethod def _iter_path_collection(paths, path_transforms, offsets, styles): """Build an iterator over the elements of the path collection""" N = max(len(paths), len(offsets)) if not path_transforms: path_transforms = [np.eye(3)] edgecolor = styles['edgecolor'] if np.size(edgecolor) == 0: edgecolor = ['none'] facecolor = styles['facecolor'] if np.size(facecolor) == 0: facecolor = ['none'] elements = [paths, path_transforms, offsets, edgecolor, styles['linewidth'], facecolor] it = itertools return it.islice(py3k.zip(*py3k.map(it.cycle, elements)), N) def draw_path_collection(self, paths, path_coordinates, path_transforms, offsets, offset_coordinates, offset_order, styles, mplobj=None): """ Draw a collection of paths. The paths, offsets, and styles are all iterables, and the number of paths is max(len(paths), len(offsets)). By default, this is implemented via multiple calls to the draw_path() function. For efficiency, Renderers may choose to customize this implementation. Examples of path collections created by matplotlib are scatter plots, histograms, contour plots, and many others. Parameters ---------- paths : list list of tuples, where each tuple has two elements: (data, pathcodes). See draw_path() for a description of these. path_coordinates: string the coordinates code for the paths, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. path_transforms: array_like an array of shape (*, 3, 3), giving a series of 2D Affine transforms for the paths. These encode translations, rotations, and scalings in the standard way. offsets: array_like An array of offsets of shape (N, 2) offset_coordinates : string the coordinates code for the offsets, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. offset_order : string either "before" or "after". This specifies whether the offset is applied before the path transform, or after. The matplotlib backend equivalent is "before"->"data", "after"->"screen". styles: dictionary A dictionary in which each value is a list of length N, containing the style(s) for the paths. mplobj : matplotlib object the matplotlib plot element which generated this collection """ if offset_order == "before": raise NotImplementedError("offset before transform") for tup in self._iter_path_collection(paths, path_transforms, offsets, styles): (path, path_transform, offset, ec, lw, fc) = tup vertices, pathcodes = path path_transform = transforms.Affine2D(path_transform) vertices = path_transform.transform(vertices) # This is a hack: if path_coordinates == "figure": path_coordinates = "points" style = {"edgecolor": utils.color_to_hex(ec), "facecolor": utils.color_to_hex(fc), "edgewidth": lw, "dasharray": "10,0", "alpha": styles['alpha'], "zorder": styles['zorder']} self.draw_path(data=vertices, coordinates=path_coordinates, pathcodes=pathcodes, style=style, offset=offset, offset_coordinates=offset_coordinates, mplobj=mplobj) def draw_markers(self, data, coordinates, style, label, mplobj=None): """ Draw a set of markers. By default, this is done by repeatedly calling draw_path(), but renderers should generally overload this method to provide a more efficient implementation. In matplotlib, markers are created using the plt.plot() command. Parameters ---------- data : array_like A shape (N, 2) array of datapoints. coordinates : string A string code, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. style : dictionary a dictionary specifying the appearance of the markers. mplobj : matplotlib object the matplotlib plot element which generated this marker collection """ vertices, pathcodes = style['markerpath'] pathstyle = dict((key, style[key]) for key in ['alpha', 'edgecolor', 'facecolor', 'zorder', 'edgewidth']) pathstyle['dasharray'] = "10,0" for vertex in data: self.draw_path(data=vertices, coordinates="points", pathcodes=pathcodes, style=pathstyle, offset=vertex, offset_coordinates=coordinates, mplobj=mplobj) def draw_text(self, text, position, coordinates, style, text_type=None, mplobj=None): """ Draw text on the image. Parameters ---------- text : string The text to draw position : tuple The (x, y) position of the text coordinates : string A string code, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. style : dictionary a dictionary specifying the appearance of the text. text_type : string or None if specified, a type of text such as "xlabel", "ylabel", "title" mplobj : matplotlib object the matplotlib plot element which generated this text """ raise NotImplementedError() def draw_path(self, data, coordinates, pathcodes, style, offset=None, offset_coordinates="data", mplobj=None): """ Draw a path. In matplotlib, paths are created by filled regions, histograms, contour plots, patches, etc. Parameters ---------- data : array_like A shape (N, 2) array of datapoints. coordinates : string A string code, which should be either 'data' for data coordinates, 'figure' for figure (pixel) coordinates, or "points" for raw point coordinates (useful in conjunction with offsets, below). pathcodes : list A list of single-character SVG pathcodes associated with the data. Path codes are one of ['M', 'm', 'L', 'l', 'Q', 'q', 'T', 't', 'S', 's', 'C', 'c', 'Z', 'z'] See the SVG specification for details. Note that some path codes consume more than one datapoint (while 'Z' consumes none), so in general, the length of the pathcodes list will not be the same as that of the data array. style : dictionary a dictionary specifying the appearance of the line. offset : list (optional) the (x, y) offset of the path. If not given, no offset will be used. offset_coordinates : string (optional) A string code, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. mplobj : matplotlib object the matplotlib plot element which generated this path """ raise NotImplementedError() def draw_image(self, imdata, extent, coordinates, style, mplobj=None): """ Draw an image. Parameters ---------- imdata : string base64 encoded png representation of the image extent : list the axes extent of the image: [xmin, xmax, ymin, ymax] coordinates: string A string code, which should be either 'data' for data coordinates, or 'figure' for figure (pixel) coordinates. style : dictionary a dictionary specifying the appearance of the image mplobj : matplotlib object the matplotlib plot object which generated this image """ raise NotImplementedError() plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/renderers/fake_renderer.py0000644000175000017500000000500113104403274030020 0ustar noahfxnoahfxfrom .base import Renderer class FakeRenderer(Renderer): """ Fake Renderer This is a fake renderer which simply outputs a text tree representing the elements found in the plot(s). This is used in the unit tests for the package. Below are the methods your renderer must implement. You are free to do anything you wish within the renderer (i.e. build an XML or JSON representation, call an external API, etc.) Here the renderer just builds a simple string representation for testing purposes. """ def __init__(self): self.output = "" def open_figure(self, fig, props): self.output += "opening figure\n" def close_figure(self, fig): self.output += "closing figure\n" def open_axes(self, ax, props): self.output += " opening axes\n" def close_axes(self, ax): self.output += " closing axes\n" def open_legend(self, legend, props): self.output += " opening legend\n" def close_legend(self, legend): self.output += " closing legend\n" def draw_text(self, text, position, coordinates, style, text_type=None, mplobj=None): self.output += " draw text '{0}' {1}\n".format(text, text_type) def draw_path(self, data, coordinates, pathcodes, style, offset=None, offset_coordinates="data", mplobj=None): self.output += " draw path with {0} vertices\n".format(data.shape[0]) def draw_image(self, imdata, extent, coordinates, style, mplobj=None): self.output += " draw image of size {0}\n".format(len(imdata)) class FullFakeRenderer(FakeRenderer): """ Renderer with the full complement of methods. When the following are left undefined, they will be implemented via other methods in the class. They can be defined explicitly for more efficient or specialized use within the renderer implementation. """ def draw_line(self, data, coordinates, style, label, mplobj=None): self.output += " draw line with {0} points\n".format(data.shape[0]) def draw_markers(self, data, coordinates, style, label, mplobj=None): self.output += " draw {0} markers\n".format(data.shape[0]) def draw_path_collection(self, paths, path_coordinates, path_transforms, offsets, offset_coordinates, offset_order, styles, mplobj=None): self.output += (" draw path collection " "with {0} offsets\n".format(offsets.shape[0])) plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/renderers/vega_renderer.py0000644000175000017500000001224413104403274030043 0ustar noahfxnoahfximport warnings import json import random from .base import Renderer from ..exporter import Exporter class VegaRenderer(Renderer): def open_figure(self, fig, props): self.props = props self.figwidth = int(props['figwidth'] * props['dpi']) self.figheight = int(props['figheight'] * props['dpi']) self.data = [] self.scales = [] self.axes = [] self.marks = [] def open_axes(self, ax, props): if len(self.axes) > 0: warnings.warn("multiple axes not yet supported") self.axes = [dict(type="x", scale="x", ticks=10), dict(type="y", scale="y", ticks=10)] self.scales = [dict(name="x", domain=props['xlim'], type="linear", range="width", ), dict(name="y", domain=props['ylim'], type="linear", range="height", ),] def draw_line(self, data, coordinates, style, label, mplobj=None): if coordinates != 'data': warnings.warn("Only data coordinates supported. Skipping this") dataname = "table{0:03d}".format(len(self.data) + 1) # TODO: respect the other style settings self.data.append({'name': dataname, 'values': [dict(x=d[0], y=d[1]) for d in data]}) self.marks.append({'type': 'line', 'from': {'data': dataname}, 'properties': { "enter": { "interpolate": {"value": "monotone"}, "x": {"scale": "x", "field": "data.x"}, "y": {"scale": "y", "field": "data.y"}, "stroke": {"value": style['color']}, "strokeOpacity": {"value": style['alpha']}, "strokeWidth": {"value": style['linewidth']}, } } }) def draw_markers(self, data, coordinates, style, label, mplobj=None): if coordinates != 'data': warnings.warn("Only data coordinates supported. Skipping this") dataname = "table{0:03d}".format(len(self.data) + 1) # TODO: respect the other style settings self.data.append({'name': dataname, 'values': [dict(x=d[0], y=d[1]) for d in data]}) self.marks.append({'type': 'symbol', 'from': {'data': dataname}, 'properties': { "enter": { "interpolate": {"value": "monotone"}, "x": {"scale": "x", "field": "data.x"}, "y": {"scale": "y", "field": "data.y"}, "fill": {"value": style['facecolor']}, "fillOpacity": {"value": style['alpha']}, "stroke": {"value": style['edgecolor']}, "strokeOpacity": {"value": style['alpha']}, "strokeWidth": {"value": style['edgewidth']}, } } }) def draw_text(self, text, position, coordinates, style, text_type=None, mplobj=None): if text_type == 'xlabel': self.axes[0]['title'] = text elif text_type == 'ylabel': self.axes[1]['title'] = text class VegaHTML(object): def __init__(self, renderer): self.specification = dict(width=renderer.figwidth, height=renderer.figheight, data=renderer.data, scales=renderer.scales, axes=renderer.axes, marks=renderer.marks) def html(self): """Build the HTML representation for IPython.""" id = random.randint(0, 2 ** 16) html = '
' % id html += '\n' return html def _repr_html_(self): return self.html() def fig_to_vega(fig, notebook=False): """Convert a matplotlib figure to vega dictionary if notebook=True, then return an object which will display in a notebook otherwise, return an HTML string. """ renderer = VegaRenderer() Exporter(renderer).run(fig) vega_html = VegaHTML(renderer) if notebook: return vega_html else: return vega_html.html() VEGA_TEMPLATE = """ ( function() { var _do_plot = function() { if ( (typeof vg == 'undefined') && (typeof IPython != 'undefined')) { $([IPython.events]).on("vega_loaded.vincent", _do_plot); return; } vg.parse.spec(%s, function(chart) { chart({el: "#vis%d"}).update(); }); }; _do_plot(); })(); """ plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/renderers/vincent_renderer.py0000644000175000017500000000360213104403274030565 0ustar noahfxnoahfximport warnings from .base import Renderer from ..exporter import Exporter class VincentRenderer(Renderer): def open_figure(self, fig, props): self.chart = None self.figwidth = int(props['figwidth'] * props['dpi']) self.figheight = int(props['figheight'] * props['dpi']) def draw_line(self, data, coordinates, style, label, mplobj=None): import vincent # only import if VincentRenderer is used if coordinates != 'data': warnings.warn("Only data coordinates supported. Skipping this") linedata = {'x': data[:, 0], 'y': data[:, 1]} line = vincent.Line(linedata, iter_idx='x', width=self.figwidth, height=self.figheight) # TODO: respect the other style settings line.scales['color'].range = [style['color']] if self.chart is None: self.chart = line else: warnings.warn("Multiple plot elements not yet supported") def draw_markers(self, data, coordinates, style, label, mplobj=None): import vincent # only import if VincentRenderer is used if coordinates != 'data': warnings.warn("Only data coordinates supported. Skipping this") markerdata = {'x': data[:, 0], 'y': data[:, 1]} markers = vincent.Scatter(markerdata, iter_idx='x', width=self.figwidth, height=self.figheight) # TODO: respect the other style settings markers.scales['color'].range = [style['facecolor']] if self.chart is None: self.chart = markers else: warnings.warn("Multiple plot elements not yet supported") def fig_to_vincent(fig): """Convert a matplotlib figure to a vincent object""" renderer = VincentRenderer() exporter = Exporter(renderer) exporter.run(fig) return renderer.chart plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/renderers/__init__.py0000644000175000017500000000065113104403274026771 0ustar noahfxnoahfx""" Matplotlib Renderers ==================== This submodule contains renderer objects which define renderer behavior used within the Exporter class. The base renderer class is :class:`Renderer`, an abstract base class """ from .base import Renderer from .vega_renderer import VegaRenderer, fig_to_vega from .vincent_renderer import VincentRenderer, fig_to_vincent from .fake_renderer import FakeRenderer, FullFakeRenderer plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/tools.py0000644000175000017500000000330413104403274024377 0ustar noahfxnoahfx""" Tools for matplotlib plot exporting """ def ipynb_vega_init(): """Initialize the IPython notebook display elements This function borrows heavily from the excellent vincent package: http://github.com/wrobstory/vincent """ try: from IPython.core.display import display, HTML except ImportError: print('IPython Notebook could not be loaded.') require_js = ''' if (window['d3'] === undefined) {{ require.config({{ paths: {{d3: "http://d3js.org/d3.v3.min"}} }}); require(["d3"], function(d3) {{ window.d3 = d3; {0} }}); }}; if (window['topojson'] === undefined) {{ require.config( {{ paths: {{topojson: "http://d3js.org/topojson.v1.min"}} }} ); require(["topojson"], function(topojson) {{ window.topojson = topojson; }}); }}; ''' d3_geo_projection_js_url = "http://d3js.org/d3.geo.projection.v0.min.js" d3_layout_cloud_js_url = ("http://wrobstory.github.io/d3-cloud/" "d3.layout.cloud.js") topojson_js_url = "http://d3js.org/topojson.v1.min.js" vega_js_url = 'http://trifacta.github.com/vega/vega.js' dep_libs = '''$.getScript("%s", function() { $.getScript("%s", function() { $.getScript("%s", function() { $.getScript("%s", function() { $([IPython.events]).trigger("vega_loaded.vincent"); }) }) }) });''' % (d3_geo_projection_js_url, d3_layout_cloud_js_url, topojson_js_url, vega_js_url) load_js = require_js.format(dep_libs) html = '' display(HTML(html)) plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/__init__.py0000644000175000017500000000007713104403274025002 0ustar noahfxnoahfxfrom .renderers import Renderer from .exporter import Exporter plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mplexporter/_py3k_compat.py0000644000175000017500000000067013104403274025632 0ustar noahfxnoahfx""" Simple fixes for Python 2/3 compatibility """ import sys PY3K = sys.version_info[0] >= 3 if PY3K: import builtins import functools reduce = functools.reduce zip = builtins.zip xrange = builtins.range map = builtins.map else: import __builtin__ import itertools builtins = __builtin__ reduce = __builtin__.reduce zip = itertools.izip xrange = __builtin__.xrange map = itertools.imap plotly-2.2.3+dfsg.orig/plotly/matplotlylib/renderer.py0000644000175000017500000007451113104403274022474 0ustar noahfxnoahfx""" Renderer Module This module defines the PlotlyRenderer class and a single function, fig_to_plotly, which is intended to be the main way that user's will interact with the matplotlylib package. """ from __future__ import absolute_import import warnings import plotly.graph_objs as go from plotly.matplotlylib.mplexporter import Renderer from plotly.matplotlylib import mpltools # Warning format def warning_on_one_line(msg, category, filename, lineno, file=None, line=None): return '%s:%s: %s:\n\n%s\n\n' % (filename, lineno, category.__name__, msg) warnings.formatwarning = warning_on_one_line class PlotlyRenderer(Renderer): """A renderer class inheriting from base for rendering mpl plots in plotly. A renderer class to be used with an exporter for rendering matplotlib plots in Plotly. This module defines the PlotlyRenderer class which handles the creation of the JSON structures that get sent to plotly. All class attributes available are defined in __init__(). Basic Usage: # (mpl code) # fig = gcf() renderer = PlotlyRenderer(fig) exporter = Exporter(renderer) exporter.run(fig) # ... et voila """ def __init__(self): """Initialize PlotlyRenderer obj. PlotlyRenderer obj is called on by an Exporter object to draw matplotlib objects like figures, axes, text, etc. All class attributes are listed here in the __init__ method. """ self.plotly_fig = go.Figure() self.mpl_fig = None self.current_mpl_ax = None self.bar_containers = None self.current_bars = [] self.axis_ct = 0 self.x_is_mpl_date = False self.mpl_x_bounds = (0, 1) self.mpl_y_bounds = (0, 1) self.msg = "Initialized PlotlyRenderer\n" def open_figure(self, fig, props): """Creates a new figure by beginning to fill out layout dict. The 'autosize' key is set to false so that the figure will mirror sizes set by mpl. The 'hovermode' key controls what shows up when you mouse around a figure in plotly, it's set to show the 'closest' point. Positional agurments: fig -- a matplotlib.figure.Figure object. props.keys(): [ 'figwidth', 'figheight', 'dpi' ] """ self.msg += "Opening figure\n" self.mpl_fig = fig self.plotly_fig['layout'] = go.Layout( width=int(props['figwidth'] * props['dpi']), height=int(props['figheight'] * props['dpi']), autosize=False, hovermode='closest') self.mpl_x_bounds, self.mpl_y_bounds = mpltools.get_axes_bounds(fig) margin = go.Margin( l=int(self.mpl_x_bounds[0] * self.plotly_fig['layout']['width']), r=int( (1-self.mpl_x_bounds[1]) * self.plotly_fig['layout']['width']), t=int((1-self.mpl_y_bounds[1]) * self.plotly_fig['layout'][ 'height']), b=int(self.mpl_y_bounds[0] * self.plotly_fig['layout']['height']), pad=0) self.plotly_fig['layout']['margin'] = margin def close_figure(self, fig): """Closes figure by cleaning up data and layout dictionaries. The PlotlyRenderer's job is to create an appropriate set of data and layout dictionaries. When the figure is closed, some cleanup and repair is necessary. This method removes inappropriate dictionary entries, freeing up Plotly to use defaults and best judgements to complete the entries. This method is called by an Exporter object. Positional arguments: fig -- a matplotlib.figure.Figure object. """ self.plotly_fig.force_clean() self.plotly_fig['layout']['showlegend'] = False self.msg += "Closing figure\n" def open_axes(self, ax, props): """Setup a new axes object (subplot in plotly). Plotly stores information about subplots in different 'xaxis' and 'yaxis' objects which are numbered. These are just dictionaries included in the layout dictionary. This function takes information from the Exporter, fills in appropriate dictionary entries, and updates the layout dictionary. PlotlyRenderer keeps track of the number of plots by incrementing the axis_ct attribute. Setting the proper plot domain in plotly is a bit tricky. Refer to the documentation for mpltools.convert_x_domain and mpltools.convert_y_domain. Positional arguments: ax -- an mpl axes object. This will become a subplot in plotly. props.keys() -- [ 'axesbg', (background color for axes obj) 'axesbgalpha', (alpha, or opacity for background) 'bounds', ((x0, y0, width, height) for axes) 'dynamic', (zoom/pan-able?) 'axes', (list: [xaxis, yaxis]) 'xscale', (log, linear, or date) 'yscale', 'xlim', (range limits for x) 'ylim', 'xdomain' (xdomain=xlim, unless it's a date) 'ydomain' ] """ self.msg += " Opening axes\n" self.current_mpl_ax = ax self.bar_containers = [c for c in ax.containers # empty is OK if c.__class__.__name__ == 'BarContainer'] self.current_bars = [] self.axis_ct += 1 # set defaults in axes xaxis = go.XAxis( anchor='y{0}'.format(self.axis_ct), zeroline=False, ticks='inside') yaxis = go.YAxis( anchor='x{0}'.format(self.axis_ct), zeroline=False, ticks='inside') # update defaults with things set in mpl mpl_xaxis, mpl_yaxis = mpltools.prep_xy_axis( ax=ax, props=props, x_bounds=self.mpl_x_bounds, y_bounds=self.mpl_y_bounds) xaxis.update(mpl_xaxis) yaxis.update(mpl_yaxis) bottom_spine = mpltools.get_spine_visible(ax, 'bottom') top_spine = mpltools.get_spine_visible(ax, 'top') left_spine = mpltools.get_spine_visible(ax, 'left') right_spine = mpltools.get_spine_visible(ax, 'right') xaxis['mirror'] = mpltools.get_axis_mirror(bottom_spine, top_spine) yaxis['mirror'] = mpltools.get_axis_mirror(left_spine, right_spine) xaxis['showline'] = bottom_spine yaxis['showline'] = top_spine # put axes in our figure self.plotly_fig['layout']['xaxis{0}'.format(self.axis_ct)] = xaxis self.plotly_fig['layout']['yaxis{0}'.format(self.axis_ct)] = yaxis # let all subsequent dates be handled properly if required if xaxis.get('type') == 'date': self.x_is_mpl_date = True def close_axes(self, ax): """Close the axes object and clean up. Bars from bar charts are given to PlotlyRenderer one-by-one, thus they need to be taken care of at the close of each axes object. The self.current_bars variable should be empty unless a bar chart has been created. Positional arguments: ax -- an mpl axes object, not required at this time. """ self.draw_bars(self.current_bars) self.msg += " Closing axes\n" self.x_is_mpl_date = False def draw_bars(self, bars): # sort bars according to bar containers mpl_traces = [] for container in self.bar_containers: mpl_traces.append([bar_props for bar_props in self.current_bars if bar_props['mplobj'] in container]) for trace in mpl_traces: self.draw_bar(trace) def draw_bar(self, coll): """Draw a collection of similar patches as a bar chart. After bars are sorted, an appropriate data dictionary must be created to tell plotly about this data. Just like draw_line or draw_markers, draw_bar translates patch/path information into something plotly understands. Positional arguments: patch_coll -- a collection of patches to be drawn as a bar chart. """ tol = 1e-10 trace = [mpltools.make_bar(**bar_props) for bar_props in coll] widths = [bar_props['x1'] - bar_props['x0'] for bar_props in trace] heights = [bar_props['y1'] - bar_props['y0'] for bar_props in trace] vertical = abs( sum(widths[0] - widths[iii] for iii in range(len(widths))) ) < tol horizontal = abs( sum(heights[0] - heights[iii] for iii in range(len(heights))) ) < tol if vertical and horizontal: # Check for monotonic x. Can't both be true! x_zeros = [bar_props['x0'] for bar_props in trace] if all((x_zeros[iii + 1] > x_zeros[iii] for iii in range(len(x_zeros[:-1])))): orientation = 'v' else: orientation = 'h' elif vertical: orientation = 'v' else: orientation = 'h' if orientation == 'v': self.msg += " Attempting to draw a vertical bar chart\n" old_heights = [bar_props['y1'] for bar_props in trace] for bar in trace: bar['y0'], bar['y1'] = 0, bar['y1'] - bar['y0'] new_heights = [bar_props['y1'] for bar_props in trace] # check if we're stacked or not... for old, new in zip(old_heights, new_heights): if abs(old - new) > tol: self.plotly_fig['layout']['barmode'] = 'stack' self.plotly_fig['layout']['hovermode'] = 'x' x = [bar['x0'] + (bar['x1'] - bar['x0']) / 2 for bar in trace] y = [bar['y1'] for bar in trace] bar_gap = mpltools.get_bar_gap([bar['x0'] for bar in trace], [bar['x1'] for bar in trace]) if self.x_is_mpl_date: x = [bar['x0'] for bar in trace] formatter = (self.current_mpl_ax.get_xaxis() .get_major_formatter().__class__.__name__) x = mpltools.mpl_dates_to_datestrings(x, formatter) else: self.msg += " Attempting to draw a horizontal bar chart\n" old_rights = [bar_props['x1'] for bar_props in trace] for bar in trace: bar['x0'], bar['x1'] = 0, bar['x1'] - bar['x0'] new_rights = [bar_props['x1'] for bar_props in trace] # check if we're stacked or not... for old, new in zip(old_rights, new_rights): if abs(old - new) > tol: self.plotly_fig['layout']['barmode'] = 'stack' self.plotly_fig['layout']['hovermode'] = 'y' x = [bar['x1'] for bar in trace] y = [bar['y0'] + (bar['y1'] - bar['y0']) / 2 for bar in trace] bar_gap = mpltools.get_bar_gap([bar['y0'] for bar in trace], [bar['y1'] for bar in trace]) bar = go.Bar( orientation=orientation, x=x, y=y, xaxis='x{0}'.format(self.axis_ct), yaxis='y{0}'.format(self.axis_ct), opacity=trace[0]['alpha'], # TODO: get all alphas if array? marker=go.Marker( color=trace[0]['facecolor'], # TODO: get all line=go.Line(width=trace[0]['edgewidth']))) # TODO ditto if len(bar['x']) > 1: self.msg += " Heck yeah, I drew that bar chart\n" self.plotly_fig['data'] += bar, if bar_gap is not None: self.plotly_fig['layout']['bargap'] = bar_gap else: self.msg += " Bar chart not drawn\n" warnings.warn('found box chart data with length <= 1, ' 'assuming data redundancy, not plotting.') def draw_marked_line(self, **props): """Create a data dict for a line obj. This will draw 'lines', 'markers', or 'lines+markers'. props.keys() -- [ 'coordinates', ('data', 'axes', 'figure', or 'display') 'data', (a list of xy pairs) 'mplobj', (the matplotlib.lines.Line2D obj being rendered) 'label', (the name of the Line2D obj being rendered) 'linestyle', (linestyle dict, can be None, see below) 'markerstyle', (markerstyle dict, can be None, see below) ] props['linestyle'].keys() -- [ 'alpha', (opacity of Line2D obj) 'color', (color of the line if it exists, not the marker) 'linewidth', 'dasharray', (code for linestyle, see DASH_MAP in mpltools.py) 'zorder', (viewing precedence when stacked with other objects) ] props['markerstyle'].keys() -- [ 'alpha', (opacity of Line2D obj) 'marker', (the mpl marker symbol, see SYMBOL_MAP in mpltools.py) 'facecolor', (color of the marker face) 'edgecolor', (color of the marker edge) 'edgewidth', (width of marker edge) 'markerpath', (an SVG path for drawing the specified marker) 'zorder', (viewing precedence when stacked with other objects) ] """ self.msg += " Attempting to draw a line " line, marker = {}, {} if props['linestyle'] and props['markerstyle']: self.msg += "... with both lines+markers\n" mode = "lines+markers" elif props['linestyle']: self.msg += "... with just lines\n" mode = "lines" elif props['markerstyle']: self.msg += "... with just markers\n" mode = "markers" if props['linestyle']: color = \ mpltools.merge_color_and_opacity(props['linestyle']['color'], props['linestyle']['alpha']) line = go.Line( color=color, width=props['linestyle']['linewidth'], dash=mpltools.convert_dash(props['linestyle']['dasharray']) ) if props['markerstyle']: marker = go.Marker( opacity=props['markerstyle']['alpha'], color=props['markerstyle']['facecolor'], symbol=mpltools.convert_symbol(props['markerstyle']['marker']), size=props['markerstyle']['markersize'], line=go.Line( color=props['markerstyle']['edgecolor'], width=props['markerstyle']['edgewidth'] ) ) if props['coordinates'] == 'data': marked_line = go.Scatter( mode=mode, name=props['label'], x=[xy_pair[0] for xy_pair in props['data']], y=[xy_pair[1] for xy_pair in props['data']], xaxis='x{0}'.format(self.axis_ct), yaxis='y{0}'.format(self.axis_ct), line=line, marker=marker) if self.x_is_mpl_date: formatter = (self.current_mpl_ax.get_xaxis() .get_major_formatter().__class__.__name__) marked_line['x'] = mpltools.mpl_dates_to_datestrings( marked_line['x'], formatter ) self.plotly_fig['data'] += marked_line, self.msg += " Heck yeah, I drew that line\n" else: self.msg += " Line didn't have 'data' coordinates, " \ "not drawing\n" warnings.warn("Bummer! Plotly can currently only draw Line2D " "objects from matplotlib that are in 'data' " "coordinates!") def draw_image(self, **props): """Draw image. Not implemented yet! """ self.msg += " Attempting to draw image\n" self.msg += " Not drawing image\n" warnings.warn("Aw. Snap! You're gonna have to hold off on " "the selfies for now. Plotly can't import " "images from matplotlib yet!") def draw_path_collection(self, **props): """Add a path collection to data list as a scatter plot. Current implementation defaults such collections as scatter plots. Matplotlib supports collections that have many of the same parameters in common like color, size, path, etc. However, they needn't all be the same. Plotly does not currently support such functionality and therefore, the style for the first object is taken and used to define the remaining paths in the collection. props.keys() -- [ 'paths', (structure: [vertices, path_code]) 'path_coordinates', ('data', 'axes', 'figure', or 'display') 'path_transforms', (mpl transform, including Affine2D matrix) 'offsets', (offset from axes, helpful if in 'data') 'offset_coordinates', ('data', 'axes', 'figure', or 'display') 'offset_order', 'styles', (style dict, see below) 'mplobj' (the collection obj being drawn) ] props['styles'].keys() -- [ 'linewidth', (one or more linewidths) 'facecolor', (one or more facecolors for path) 'edgecolor', (one or more edgecolors for path) 'alpha', (one or more opacites for path) 'zorder', (precedence when stacked) ] """ self.msg += " Attempting to draw a path collection\n" if props['offset_coordinates'] is 'data': markerstyle = mpltools.get_markerstyle_from_collection(props) scatter_props = { 'coordinates': 'data', 'data': props['offsets'], 'label': None, 'markerstyle': markerstyle, 'linestyle': None } self.msg += " Drawing path collection as markers\n" self.draw_marked_line(**scatter_props) else: self.msg += " Path collection not linked to 'data', " \ "not drawing\n" warnings.warn("Dang! That path collection is out of this " "world. I totally don't know what to do with " "it yet! Plotly can only import path " "collections linked to 'data' coordinates") def draw_path(self, **props): """Draw path, currently only attempts to draw bar charts. This function attempts to sort a given path into a collection of horizontal or vertical bar charts. Most of the actual code takes place in functions from mpltools.py. props.keys() -- [ 'data', (a list of verticies for the path) 'coordinates', ('data', 'axes', 'figure', or 'display') 'pathcodes', (code for the path, structure: ['M', 'L', 'Z', etc.]) 'style', (style dict, see below) 'mplobj' (the mpl path object) ] props['style'].keys() -- [ 'alpha', (opacity of path obj) 'edgecolor', 'facecolor', 'edgewidth', 'dasharray', (style for path's enclosing line) 'zorder' (precedence of obj when stacked) ] """ self.msg += " Attempting to draw a path\n" is_bar = mpltools.is_bar(self.current_mpl_ax.containers, **props) if is_bar: self.current_bars += [props] else: self.msg += " This path isn't a bar, not drawing\n" warnings.warn("I found a path object that I don't think is part " "of a bar chart. Ignoring.") def draw_text(self, **props): """Create an annotation dict for a text obj. Currently, plotly uses either 'page' or 'data' to reference annotation locations. These refer to 'display' and 'data', respectively for the 'coordinates' key used in the Exporter. Appropriate measures are taken to transform text locations to reference one of these two options. props.keys() -- [ 'text', (actual content string, not the text obj) 'position', (an x, y pair, not an mpl Bbox) 'coordinates', ('data', 'axes', 'figure', 'display') 'text_type', ('title', 'xlabel', or 'ylabel') 'style', (style dict, see below) 'mplobj' (actual mpl text object) ] props['style'].keys() -- [ 'alpha', (opacity of text) 'fontsize', (size in points of text) 'color', (hex color) 'halign', (horizontal alignment, 'left', 'center', or 'right') 'valign', (vertical alignment, 'baseline', 'center', or 'top') 'rotation', 'zorder', (precedence of text when stacked with other objs) ] """ self.msg += " Attempting to draw an mpl text object\n" if not mpltools.check_corners(props['mplobj'], self.mpl_fig): warnings.warn( "Looks like the annotation(s) you are trying \n" "to draw lies/lay outside the given figure size.\n\n" "Therefore, the resulting Plotly figure may not be \n" "large enough to view the full text. To adjust \n" "the size of the figure, use the 'width' and \n" "'height' keys in the Layout object. Alternatively,\n" "use the Margin object to adjust the figure's margins.") align = props['mplobj']._multialignment if not align: align = props['style']['halign'] # mpl default if 'annotations' not in self.plotly_fig['layout']: self.plotly_fig['layout']['annotations'] = go.Annotations() if props['text_type'] == 'xlabel': self.msg += " Text object is an xlabel\n" self.draw_xlabel(**props) elif props['text_type'] == 'ylabel': self.msg += " Text object is a ylabel\n" self.draw_ylabel(**props) elif props['text_type'] == 'title': self.msg += " Text object is a title\n" self.draw_title(**props) else: # just a regular text annotation... self.msg += " Text object is a normal annotation\n" if props['coordinates'] is not 'data': self.msg += " Text object isn't linked to 'data' " \ "coordinates\n" x_px, y_px = props['mplobj'].get_transform().transform( props['position']) x, y = mpltools.display_to_paper( x_px, y_px, self.plotly_fig['layout'] ) xref = 'paper' yref = 'paper' xanchor = props['style']['halign'] # no difference here! yanchor = mpltools.convert_va(props['style']['valign']) else: self.msg += " Text object is linked to 'data' " \ "coordinates\n" x, y = props['position'] axis_ct = self.axis_ct xaxis = self.plotly_fig['layout']['xaxis{0}'.format(axis_ct)] yaxis = self.plotly_fig['layout']['yaxis{0}'.format(axis_ct)] if (xaxis['range'][0] < x < xaxis['range'][1] and yaxis['range'][0] < y < yaxis['range'][1]): xref = 'x{0}'.format(self.axis_ct) yref = 'y{0}'.format(self.axis_ct) else: self.msg += " Text object is outside " \ "plotting area, making 'paper' reference.\n" x_px, y_px = props['mplobj'].get_transform().transform( props['position']) x, y = mpltools.display_to_paper(x_px, y_px, self.plotly_fig['layout']) xref = 'paper' yref = 'paper' xanchor = props['style']['halign'] # no difference here! yanchor = mpltools.convert_va(props['style']['valign']) annotation = go.Annotation( text=props['text'], opacity=props['style']['alpha'], x=x, y=y, xref=xref, yref=yref, align=align, xanchor=xanchor, yanchor=yanchor, showarrow=False, # change this later? font=go.Font( color=props['style']['color'], size=props['style']['fontsize'] ) ) self.plotly_fig['layout']['annotations'] += annotation, self.msg += " Heck, yeah I drew that annotation\n" def draw_title(self, **props): """Add a title to the current subplot in layout dictionary. If there exists more than a single plot in the figure, titles revert to 'page'-referenced annotations. props.keys() -- [ 'text', (actual content string, not the text obj) 'position', (an x, y pair, not an mpl Bbox) 'coordinates', ('data', 'axes', 'figure', 'display') 'text_type', ('title', 'xlabel', or 'ylabel') 'style', (style dict, see below) 'mplobj' (actual mpl text object) ] props['style'].keys() -- [ 'alpha', (opacity of text) 'fontsize', (size in points of text) 'color', (hex color) 'halign', (horizontal alignment, 'left', 'center', or 'right') 'valign', (vertical alignment, 'baseline', 'center', or 'top') 'rotation', 'zorder', (precedence of text when stacked with other objs) ] """ self.msg += " Attempting to draw a title\n" if len(self.mpl_fig.axes) > 1: self.msg += " More than one subplot, adding title as " \ "annotation\n" x_px, y_px = props['mplobj'].get_transform().transform(props[ 'position']) x, y = mpltools.display_to_paper(x_px, y_px, self.plotly_fig['layout']) annotation = go.Annotation( text=props['text'], font=go.Font( color=props['style']['color'], size=props['style']['fontsize'] ), xref='paper', yref='paper', x=x, y=y, xanchor='center', yanchor='bottom', showarrow=False # no arrow for a title! ) self.plotly_fig['layout']['annotations'] += annotation, else: self.msg += " Only one subplot found, adding as a " \ "plotly title\n" self.plotly_fig['layout']['title'] = props['text'] titlefont = go.Font( size=props['style']['fontsize'], color=props['style']['color'] ) self.plotly_fig['layout']['titlefont'] = titlefont def draw_xlabel(self, **props): """Add an xaxis label to the current subplot in layout dictionary. props.keys() -- [ 'text', (actual content string, not the text obj) 'position', (an x, y pair, not an mpl Bbox) 'coordinates', ('data', 'axes', 'figure', 'display') 'text_type', ('title', 'xlabel', or 'ylabel') 'style', (style dict, see below) 'mplobj' (actual mpl text object) ] props['style'].keys() -- [ 'alpha', (opacity of text) 'fontsize', (size in points of text) 'color', (hex color) 'halign', (horizontal alignment, 'left', 'center', or 'right') 'valign', (vertical alignment, 'baseline', 'center', or 'top') 'rotation', 'zorder', (precedence of text when stacked with other objs) ] """ self.msg += " Adding xlabel\n" axis_key = 'xaxis{0}'.format(self.axis_ct) self.plotly_fig['layout'][axis_key]['title'] = props['text'] titlefont = go.Font( size=props['style']['fontsize'], color=props['style']['color']) self.plotly_fig['layout'][axis_key]['titlefont'] = titlefont def draw_ylabel(self, **props): """Add a yaxis label to the current subplot in layout dictionary. props.keys() -- [ 'text', (actual content string, not the text obj) 'position', (an x, y pair, not an mpl Bbox) 'coordinates', ('data', 'axes', 'figure', 'display') 'text_type', ('title', 'xlabel', or 'ylabel') 'style', (style dict, see below) 'mplobj' (actual mpl text object) ] props['style'].keys() -- [ 'alpha', (opacity of text) 'fontsize', (size in points of text) 'color', (hex color) 'halign', (horizontal alignment, 'left', 'center', or 'right') 'valign', (vertical alignment, 'baseline', 'center', or 'top') 'rotation', 'zorder', (precedence of text when stacked with other objs) ] """ self.msg += " Adding ylabel\n" axis_key = 'yaxis{0}'.format(self.axis_ct) self.plotly_fig['layout'][axis_key]['title'] = props['text'] titlefont = go.Font( size=props['style']['fontsize'], color=props['style']['color']) self.plotly_fig['layout'][axis_key]['titlefont'] = titlefont def resize(self): """Revert figure layout to allow plotly to resize. By default, PlotlyRenderer tries its hardest to precisely mimic an mpl figure. However, plotly is pretty good with aesthetics. By running PlotlyRenderer.resize(), layout parameters are deleted. This lets plotly choose them instead of mpl. """ self.msg += "Resizing figure, deleting keys from layout\n" for key in ['width', 'height', 'autosize', 'margin']: try: del self.plotly_fig['layout'][key] except KeyError: pass def strip_style(self): self.msg += "Stripping mpl style, deleting keys from data and layout\n" self.plotly_fig.strip_style() plotly-2.2.3+dfsg.orig/plotly/matplotlylib/mpltools.py0000644000175000017500000004616013104403274022536 0ustar noahfxnoahfx""" Tools A module for converting from mpl language to plotly language. """ import math import warnings import matplotlib.dates import pytz def check_bar_match(old_bar, new_bar): """Check if two bars belong in the same collection (bar chart). Positional arguments: old_bar -- a previously sorted bar dictionary. new_bar -- a new bar dictionary that needs to be sorted. """ tests = [] tests += new_bar['orientation'] == old_bar['orientation'], tests += new_bar['facecolor'] == old_bar['facecolor'], if new_bar['orientation'] == 'v': new_width = new_bar['x1'] - new_bar['x0'] old_width = old_bar['x1'] - old_bar['x0'] tests += new_width - old_width < 0.000001, tests += new_bar['y0'] == old_bar['y0'], elif new_bar['orientation'] == 'h': new_height = new_bar['y1'] - new_bar['y0'] old_height = old_bar['y1'] - old_bar['y0'] tests += new_height - old_height < 0.000001, tests += new_bar['x0'] == old_bar['x0'], if all(tests): return True else: return False def check_corners(inner_obj, outer_obj): inner_corners = inner_obj.get_window_extent().corners() outer_corners = outer_obj.get_window_extent().corners() if inner_corners[0][0] < outer_corners[0][0]: return False elif inner_corners[0][1] < outer_corners[0][1]: return False elif inner_corners[3][0] > outer_corners[3][0]: return False elif inner_corners[3][1] > outer_corners[3][1]: return False else: return True def convert_dash(mpl_dash): """Convert mpl line symbol to plotly line symbol and return symbol.""" if mpl_dash in DASH_MAP: return DASH_MAP[mpl_dash] else: return 'solid' # default def convert_path(path): verts = path[0] # may use this later code = tuple(path[1]) if code in PATH_MAP: return PATH_MAP[code] else: return None def convert_symbol(mpl_symbol): """Convert mpl marker symbol to plotly symbol and return symbol.""" if isinstance(mpl_symbol, list): symbol = list() for s in mpl_symbol: symbol += [convert_symbol(s)] return symbol elif mpl_symbol in SYMBOL_MAP: return SYMBOL_MAP[mpl_symbol] else: return 'dot' # default def hex_to_rgb(value): """ Change a hex color to an rgb tuple :param (str|unicode) value: The hex string we want to convert. :return: (int, int, int) The red, green, blue int-tuple. Example: '#FFFFFF' --> (255, 255, 255) """ value = value.lstrip('#') lv = len(value) return tuple(int(value[i:i + lv // 3], 16) for i in range(0, lv, lv // 3)) def merge_color_and_opacity(color, opacity): """ Merge hex color with an alpha (opacity) to get an rgba tuple. :param (str|unicode) color: A hex color string. :param (float|int) opacity: A value [0, 1] for the 'a' in 'rgba'. :return: (int, int, int, float) The rgba color and alpha tuple. """ if color is None: # None can be used as a placeholder, just bail. return None rgb_tup = hex_to_rgb(color) if opacity is None: return 'rgb {}'.format(rgb_tup) rgba_tup = rgb_tup + (opacity,) return 'rgba {}'.format(rgba_tup) def convert_va(mpl_va): """Convert mpl vertical alignment word to equivalent HTML word. Text alignment specifiers from mpl differ very slightly from those used in HTML. See the VA_MAP for more details. Positional arguments: mpl_va -- vertical mpl text alignment spec. """ if mpl_va in VA_MAP: return VA_MAP[mpl_va] else: return None # let plotly figure it out! def convert_x_domain(mpl_plot_bounds, mpl_max_x_bounds): """Map x dimension of current plot to plotly's domain space. The bbox used to locate an axes object in mpl differs from the method used to locate axes in plotly. The mpl version locates each axes in the figure so that axes in a single-plot figure might have the bounds, [0.125, 0.125, 0.775, 0.775] (x0, y0, width, height), in mpl's figure coordinates. However, the axes all share one space in plotly such that the domain will always be [0, 0, 1, 1] (x0, y0, x1, y1). To convert between the two, the mpl figure bounds need to be mapped to a [0, 1] domain for x and y. The margins set upon opening a new figure will appropriately match the mpl margins. Optionally, setting margins=0 and simply copying the domains from mpl to plotly would place axes appropriately. However, this would throw off axis and title labeling. Positional arguments: mpl_plot_bounds -- the (x0, y0, width, height) params for current ax ** mpl_max_x_bounds -- overall (x0, x1) bounds for all axes ** ** these are all specified in mpl figure coordinates """ mpl_x_dom = [mpl_plot_bounds[0], mpl_plot_bounds[0]+mpl_plot_bounds[2]] plotting_width = (mpl_max_x_bounds[1]-mpl_max_x_bounds[0]) x0 = (mpl_x_dom[0]-mpl_max_x_bounds[0])/plotting_width x1 = (mpl_x_dom[1]-mpl_max_x_bounds[0])/plotting_width return [x0, x1] def convert_y_domain(mpl_plot_bounds, mpl_max_y_bounds): """Map y dimension of current plot to plotly's domain space. The bbox used to locate an axes object in mpl differs from the method used to locate axes in plotly. The mpl version locates each axes in the figure so that axes in a single-plot figure might have the bounds, [0.125, 0.125, 0.775, 0.775] (x0, y0, width, height), in mpl's figure coordinates. However, the axes all share one space in plotly such that the domain will always be [0, 0, 1, 1] (x0, y0, x1, y1). To convert between the two, the mpl figure bounds need to be mapped to a [0, 1] domain for x and y. The margins set upon opening a new figure will appropriately match the mpl margins. Optionally, setting margins=0 and simply copying the domains from mpl to plotly would place axes appropriately. However, this would throw off axis and title labeling. Positional arguments: mpl_plot_bounds -- the (x0, y0, width, height) params for current ax ** mpl_max_y_bounds -- overall (y0, y1) bounds for all axes ** ** these are all specified in mpl figure coordinates """ mpl_y_dom = [mpl_plot_bounds[1], mpl_plot_bounds[1]+mpl_plot_bounds[3]] plotting_height = (mpl_max_y_bounds[1]-mpl_max_y_bounds[0]) y0 = (mpl_y_dom[0]-mpl_max_y_bounds[0])/plotting_height y1 = (mpl_y_dom[1]-mpl_max_y_bounds[0])/plotting_height return [y0, y1] def display_to_paper(x, y, layout): """Convert mpl display coordinates to plotly paper coordinates. Plotly references object positions with an (x, y) coordinate pair in either 'data' or 'paper' coordinates which reference actual data in a plot or the entire plotly axes space where the bottom-left of the bottom-left plot has the location (x, y) = (0, 0) and the top-right of the top-right plot has the location (x, y) = (1, 1). Display coordinates in mpl reference objects with an (x, y) pair in pixel coordinates, where the bottom-left corner is at the location (x, y) = (0, 0) and the top-right corner is at the location (x, y) = (figwidth*dpi, figheight*dpi). Here, figwidth and figheight are in inches and dpi are the dots per inch resolution. """ num_x = x - layout['margin']['l'] den_x = layout['width'] - (layout['margin']['l'] + layout['margin']['r']) num_y = y - layout['margin']['b'] den_y = layout['height'] - (layout['margin']['b'] + layout['margin']['t']) return num_x/den_x, num_y/den_y def get_axes_bounds(fig): """Return the entire axes space for figure. An axes object in mpl is specified by its relation to the figure where (0,0) corresponds to the bottom-left part of the figure and (1,1) corresponds to the top-right. Margins exist in matplotlib because axes objects normally don't go to the edges of the figure. In plotly, the axes area (where all subplots go) is always specified with the domain [0,1] for both x and y. This function finds the smallest box, specified by two points, that all of the mpl axes objects fit into. This box is then used to map mpl axes domains to plotly axes domains. """ x_min, x_max, y_min, y_max = [], [], [], [] for axes_obj in fig.get_axes(): bounds = axes_obj.get_position().bounds x_min.append(bounds[0]) x_max.append(bounds[0]+bounds[2]) y_min.append(bounds[1]) y_max.append(bounds[1]+bounds[3]) x_min, y_min, x_max, y_max = min(x_min), min(y_min), max(x_max), max(y_max) return (x_min, x_max), (y_min, y_max) def get_axis_mirror(main_spine, mirror_spine): if main_spine and mirror_spine: return 'ticks' elif main_spine and not mirror_spine: return False elif not main_spine and mirror_spine: return False # can't handle this case yet! else: return False # nuttin'! def get_bar_gap(bar_starts, bar_ends, tol=1e-10): if len(bar_starts) == len(bar_ends) and len(bar_starts) > 1: sides1 = bar_starts[1:] sides2 = bar_ends[:-1] gaps = [s2-s1 for s2, s1 in zip(sides1, sides2)] gap0 = gaps[0] uniform = all([abs(gap0-gap) < tol for gap in gaps]) if uniform: return gap0 def convert_rgba_array(color_list): clean_color_list = list() for c in color_list: clean_color_list += [(dict(r=int(c[0]*255), g=int(c[1]*255), b=int(c[2]*255), a=c[3] ))] plotly_colors = list() for rgba in clean_color_list: plotly_colors += ["rgba({r},{g},{b},{a})".format(**rgba)] if len(plotly_colors) == 1: return plotly_colors[0] else: return plotly_colors def convert_path_array(path_array): symbols = list() for path in path_array: symbols += [convert_path(path)] if len(symbols) == 1: return symbols[0] else: return symbols def convert_linewidth_array(width_array): if len(width_array) == 1: return width_array[0] else: return width_array def convert_size_array(size_array): size = [math.sqrt(s) for s in size_array] if len(size) == 1: return size[0] else: return size def get_markerstyle_from_collection(props): markerstyle=dict( alpha=None, facecolor=convert_rgba_array(props['styles']['facecolor']), marker=convert_path_array(props['paths']), edgewidth=convert_linewidth_array(props['styles']['linewidth']), # markersize=convert_size_array(props['styles']['size']), # TODO! markersize=convert_size_array(props['mplobj'].get_sizes()), edgecolor=convert_rgba_array(props['styles']['edgecolor']) ) return markerstyle def get_rect_xmin(data): """Find minimum x value from four (x,y) vertices.""" return min(data[0][0], data[1][0], data[2][0], data[3][0]) def get_rect_xmax(data): """Find maximum x value from four (x,y) vertices.""" return max(data[0][0], data[1][0], data[2][0], data[3][0]) def get_rect_ymin(data): """Find minimum y value from four (x,y) vertices.""" return min(data[0][1], data[1][1], data[2][1], data[3][1]) def get_rect_ymax(data): """Find maximum y value from four (x,y) vertices.""" return max(data[0][1], data[1][1], data[2][1], data[3][1]) def get_spine_visible(ax, spine_key): """Return some spine parameters for the spine, `spine_key`.""" spine = ax.spines[spine_key] ax_frame_on = ax.get_frame_on() spine_frame_like = spine.is_frame_like() if not spine.get_visible(): return False elif not spine._edgecolor[-1]: # user's may have set edgecolor alpha==0 return False elif not ax_frame_on and spine_frame_like: return False elif ax_frame_on and spine_frame_like: return True elif not ax_frame_on and not spine_frame_like: return True # we've already checked for that it's visible. else: return False # oh man, and i thought we exhausted the options... def is_bar(bar_containers, **props): """A test to decide whether a path is a bar from a vertical bar chart.""" # is this patch in a bar container? for container in bar_containers: if props['mplobj'] in container: return True return False def make_bar(**props): """Make an intermediate bar dictionary. This creates a bar dictionary which aids in the comparison of new bars to old bars from other bar chart (patch) collections. This is not the dictionary that needs to get passed to plotly as a data dictionary. That happens in PlotlyRenderer in that class's draw_bar method. In other words, this dictionary describes a SINGLE bar, whereas, plotly will require a set of bars to be passed in a data dictionary. """ return { 'bar': props['mplobj'], 'x0': get_rect_xmin(props['data']), 'y0': get_rect_ymin(props['data']), 'x1': get_rect_xmax(props['data']), 'y1': get_rect_ymax(props['data']), 'alpha': props['style']['alpha'], 'edgecolor': props['style']['edgecolor'], 'facecolor': props['style']['facecolor'], 'edgewidth': props['style']['edgewidth'], 'dasharray': props['style']['dasharray'], 'zorder': props['style']['zorder'] } def prep_ticks(ax, index, ax_type, props): """Prepare axis obj belonging to axes obj. positional arguments: ax - the mpl axes instance index - the index of the axis in `props` ax_type - 'x' or 'y' (for now) props - an mplexporter poperties dictionary """ axis_dict = dict() if ax_type == 'x': axis = ax.get_xaxis() elif ax_type == 'y': axis = ax.get_yaxis() else: return dict() # whoops! scale = props['axes'][index]['scale'] if scale == 'linear': # get tick location information try: tickvalues = props['axes'][index]['tickvalues'] tick0 = tickvalues[0] dticks = [round(tickvalues[i]-tickvalues[i-1], 12) for i in range(1, len(tickvalues) - 1)] if all([dticks[i] == dticks[i-1] for i in range(1, len(dticks) - 1)]): dtick = tickvalues[1] - tickvalues[0] else: warnings.warn("'linear' {0}-axis tick spacing not even, " "ignoring mpl tick formatting.".format(ax_type)) raise TypeError except (IndexError, TypeError): axis_dict['nticks'] = props['axes'][index]['nticks'] else: axis_dict['tick0'] = tick0 axis_dict['dtick'] = dtick axis_dict['tickmode'] = False elif scale == 'log': try: axis_dict['tick0'] = props['axes'][index]['tickvalues'][0] axis_dict['dtick'] = props['axes'][index]['tickvalues'][1] - \ props['axes'][index]['tickvalues'][0] axis_dict['tickmode'] = False except (IndexError, TypeError): axis_dict = dict(nticks=props['axes'][index]['nticks']) base = axis.get_transform().base if base == 10: if ax_type == 'x': axis_dict['range'] = [math.log10(props['xlim'][0]), math.log10(props['xlim'][1])] elif ax_type == 'y': axis_dict['range'] = [math.log10(props['ylim'][0]), math.log10(props['ylim'][1])] else: axis_dict = dict(range=None, type='linear') warnings.warn("Converted non-base10 {0}-axis log scale to 'linear'" "".format(ax_type)) else: return dict() # get tick label formatting information formatter = axis.get_major_formatter().__class__.__name__ if ax_type == 'x' and 'DateFormatter' in formatter: axis_dict['type'] = 'date' try: axis_dict['tick0'] = mpl_dates_to_datestrings( axis_dict['tick0'], formatter ) except KeyError: pass finally: axis_dict.pop('dtick', None) axis_dict.pop('tickmode', None) axis_dict['range'] = mpl_dates_to_datestrings( props['xlim'], formatter ) if formatter == 'LogFormatterMathtext': axis_dict['exponentformat'] = 'e' return axis_dict def prep_xy_axis(ax, props, x_bounds, y_bounds): xaxis = dict( type=props['axes'][0]['scale'], range=list(props['xlim']), showgrid=props['axes'][0]['grid']['gridOn'], domain=convert_x_domain(props['bounds'], x_bounds), side=props['axes'][0]['position'], tickfont=dict(size=props['axes'][0]['fontsize']) ) xaxis.update(prep_ticks(ax, 0, 'x', props)) yaxis = dict( type=props['axes'][1]['scale'], range=list(props['ylim']), showgrid=props['axes'][1]['grid']['gridOn'], domain=convert_y_domain(props['bounds'], y_bounds), side=props['axes'][1]['position'], tickfont=dict(size=props['axes'][1]['fontsize']) ) yaxis.update(prep_ticks(ax, 1, 'y', props)) return xaxis, yaxis def mpl_dates_to_datestrings(dates, mpl_formatter): """Convert matplotlib dates to iso-formatted-like time strings. Plotly's accepted format: "YYYY-MM-DD HH:MM:SS" (e.g., 2001-01-01 00:00:00) Info on mpl dates: http://matplotlib.org/api/dates_api.html """ _dates = dates # this is a pandas datetime formatter, times show up in floating point days # since the epoch (1970-01-01T00:00:00+00:00) if mpl_formatter == "TimeSeries_DateFormatter": try: dates = matplotlib.dates.epoch2num( [date*24*60*60 for date in dates] ) dates = matplotlib.dates.num2date(dates, tz=pytz.utc) except: return _dates # the rest of mpl dates are in floating point days since # (0001-01-01T00:00:00+00:00) + 1. I.e., (0001-01-01T00:00:00+00:00) == 1.0 # according to mpl --> try num2date(1) else: try: dates = matplotlib.dates.num2date(dates, tz=pytz.utc) except: return _dates time_stings = [' '.join(date.isoformat().split('+')[0].split('T')) for date in dates] return time_stings DASH_MAP = { '10,0': 'solid', '6,6': 'dash', '2,2': 'dot', '4,4,2,4': 'dashdot', 'none': 'solid' } PATH_MAP = { ('M', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'C', 'Z'): 'o', ('M', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'Z'): '*', ('M', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'Z'): '8', ('M', 'L', 'L', 'L', 'L', 'L', 'Z'): 'h', ('M', 'L', 'L', 'L', 'L', 'Z'): 'p', ('M', 'L', 'M', 'L', 'M', 'L'): '1', ('M', 'L', 'L', 'L', 'Z'): 's', ('M', 'L', 'M', 'L'): '+', ('M', 'L', 'L', 'Z'): '^', ('M', 'L'): '|' } SYMBOL_MAP = { 'o': 'dot', 'v': 'triangle-down', '^': 'triangle-up', '<': 'triangle-left', '>': 'triangle-right', 's': 'square', '+': 'cross', 'x': 'x', '*': 'x', # no star yet in plotly!! 'D': 'diamond', 'd': 'diamond', } VA_MAP = { 'center': 'middle', 'baseline': 'bottom', 'top': 'top' } plotly-2.2.3+dfsg.orig/plotly/matplotlylib/__init__.py0000644000175000017500000000064013104403274022415 0ustar noahfxnoahfx""" matplotlylib ============ This module converts matplotlib figure objects into JSON structures which can be understood and visualized by Plotly. Most of the functionality should be accessed through the parent directory's 'tools' module or 'plotly' package. """ from __future__ import absolute_import from plotly.matplotlylib.renderer import PlotlyRenderer from plotly.matplotlylib.mplexporter import Exporter plotly-2.2.3+dfsg.orig/plotly/tools.py0000644000175000017500000016672613211605455017330 0ustar noahfxnoahfx# -*- coding: utf-8 -*- """ tools ===== Functions that USERS will possibly want access to. """ from __future__ import absolute_import import warnings import six from plotly import exceptions, optional_imports, session, utils from plotly.files import (CONFIG_FILE, CREDENTIALS_FILE, FILE_CONTENT, 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)'] REQUIRED_GANTT_KEYS = ['Task', 'Start', 'Finish'] 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)']} # color constants for violin plot DEFAULT_FILLCOLOR = '#1f77b4' DEFAULT_HISTNORM = 'probability density' ALTERNATIVE_HISTNORM = 'probability' # Warning format def warning_on_one_line(message, category, filename, lineno, file=None, line=None): return '%s:%s: %s:\n\n%s\n\n' % (filename, lineno, category.__name__, message) warnings.formatwarning = warning_on_one_line ipython_core_display = optional_imports.get_module('IPython.core.display') matplotlylib = optional_imports.get_module('plotly.matplotlylib') sage_salvus = optional_imports.get_module('sage_salvus') def get_config_defaults(): """ Convenience function to check current settings against defaults. Example: if plotly_domain != get_config_defaults()['plotly_domain']: # do something """ return dict(FILE_CONTENT[CONFIG_FILE]) # performs a shallow copy def ensure_local_plotly_files(): """Ensure that filesystem is setup/filled out in a valid way. If the config or credential files aren't filled out, then write them to the disk. """ if check_file_permissions(): for fn in [CREDENTIALS_FILE, CONFIG_FILE]: utils.ensure_file_exists(fn) contents = utils.load_json_dict(fn) contents_orig = contents.copy() for key, val in list(FILE_CONTENT[fn].items()): # TODO: removed type checking below, may want to revisit if key not in contents: contents[key] = val contents_keys = list(contents.keys()) for key in contents_keys: if key not in FILE_CONTENT[fn]: del contents[key] # save only if contents has changed. # This is to avoid .credentials or .config file to be overwritten randomly, # which we constantly keep experiencing # (sync issues? the file might be locked for writing by other process in file._permissions) if contents_orig.keys() != contents.keys(): utils.save_json_dict(fn, contents) else: warnings.warn("Looks like you don't have 'read-write' permission to " "your 'home' ('~') directory or to our '~/.plotly' " "directory. That means plotly's python api can't setup " "local configuration files. No problem though! You'll " "just have to sign-in using 'plotly.plotly.sign_in()'. " "For help with that: 'help(plotly.plotly.sign_in)'." "\nQuestions? Visit https://support.plot.ly") ### credentials tools ### def set_credentials_file(username=None, api_key=None, stream_ids=None, proxy_username=None, proxy_password=None): """Set the keyword-value pairs in `~/.plotly_credentials`. :param (str) username: The username you'd use to sign in to Plotly :param (str) api_key: The api key associated with above username :param (list) stream_ids: Stream tokens for above credentials :param (str) proxy_username: The un associated with with your Proxy :param (str) proxy_password: The pw associated with your Proxy un """ if not check_file_permissions(): raise exceptions.PlotlyError("You don't have proper file permissions " "to run this function.") ensure_local_plotly_files() # make sure what's there is OK credentials = get_credentials_file() if isinstance(username, six.string_types): credentials['username'] = username if isinstance(api_key, six.string_types): credentials['api_key'] = api_key if isinstance(proxy_username, six.string_types): credentials['proxy_username'] = proxy_username if isinstance(proxy_password, six.string_types): credentials['proxy_password'] = proxy_password if isinstance(stream_ids, (list, tuple)): credentials['stream_ids'] = stream_ids utils.save_json_dict(CREDENTIALS_FILE, credentials) ensure_local_plotly_files() # make sure what we just put there is OK def get_credentials_file(*args): """Return specified args from `~/.plotly_credentials`. as dict. Returns all if no arguments are specified. Example: get_credentials_file('username') """ if check_file_permissions(): ensure_local_plotly_files() # make sure what's there is OK return utils.load_json_dict(CREDENTIALS_FILE, *args) else: return FILE_CONTENT[CREDENTIALS_FILE] def reset_credentials_file(): ensure_local_plotly_files() # make sure what's there is OK utils.save_json_dict(CREDENTIALS_FILE, {}) ensure_local_plotly_files() # put the defaults back ### config tools ### def set_config_file(plotly_domain=None, plotly_streaming_domain=None, plotly_api_domain=None, plotly_ssl_verification=None, plotly_proxy_authorization=None, world_readable=None, sharing=None, auto_open=None): """Set the keyword-value pairs in `~/.plotly/.config`. :param (str) plotly_domain: ex - https://plot.ly :param (str) plotly_streaming_domain: ex - stream.plot.ly :param (str) plotly_api_domain: ex - https://api.plot.ly :param (bool) plotly_ssl_verification: True = verify, False = don't verify :param (bool) plotly_proxy_authorization: True = use plotly proxy auth creds :param (bool) world_readable: True = public, False = private """ if not check_file_permissions(): raise exceptions.PlotlyError("You don't have proper file permissions " "to run this function.") ensure_local_plotly_files() # make sure what's there is OK utils.validate_world_readable_and_sharing_settings({ 'sharing': sharing, 'world_readable': world_readable}) settings = get_config_file() if isinstance(plotly_domain, six.string_types): settings['plotly_domain'] = plotly_domain elif plotly_domain is not None: raise TypeError('plotly_domain should be a string') if isinstance(plotly_streaming_domain, six.string_types): settings['plotly_streaming_domain'] = plotly_streaming_domain elif plotly_streaming_domain is not None: raise TypeError('plotly_streaming_domain should be a string') if isinstance(plotly_api_domain, six.string_types): settings['plotly_api_domain'] = plotly_api_domain elif plotly_api_domain is not None: raise TypeError('plotly_api_domain should be a string') if isinstance(plotly_ssl_verification, (six.string_types, bool)): settings['plotly_ssl_verification'] = plotly_ssl_verification elif plotly_ssl_verification is not None: raise TypeError('plotly_ssl_verification should be a boolean') if isinstance(plotly_proxy_authorization, (six.string_types, bool)): settings['plotly_proxy_authorization'] = plotly_proxy_authorization elif plotly_proxy_authorization is not None: raise TypeError('plotly_proxy_authorization should be a boolean') if isinstance(auto_open, bool): settings['auto_open'] = auto_open elif auto_open is not None: raise TypeError('auto_open should be a boolean') if isinstance(world_readable, bool): settings['world_readable'] = world_readable settings.pop('sharing') elif world_readable is not None: raise TypeError('Input should be a boolean') if isinstance(sharing, six.string_types): settings['sharing'] = sharing elif sharing is not None: raise TypeError('sharing should be a string') utils.set_sharing_and_world_readable(settings) utils.save_json_dict(CONFIG_FILE, settings) ensure_local_plotly_files() # make sure what we just put there is OK def get_config_file(*args): """Return specified args from `~/.plotly/.config`. as tuple. Returns all if no arguments are specified. Example: get_config_file('plotly_domain') """ if check_file_permissions(): ensure_local_plotly_files() # make sure what's there is OK return utils.load_json_dict(CONFIG_FILE, *args) else: return FILE_CONTENT[CONFIG_FILE] def reset_config_file(): ensure_local_plotly_files() # make sure what's there is OK f = open(CONFIG_FILE, 'w') f.close() ensure_local_plotly_files() # put the defaults back ### embed tools ### def get_embed(file_owner_or_url, file_id=None, width="100%", height=525): """Returns HTML code to embed figure on a webpage as an ").format( plotly_rest_url=plotly_rest_url, file_owner=file_owner, file_id=file_id, iframe_height=height, iframe_width=width) else: s = ("").format( plotly_rest_url=plotly_rest_url, file_owner=file_owner, file_id=file_id, share_key=share_key, iframe_height=height, iframe_width=width) return s def embed(file_owner_or_url, file_id=None, width="100%", height=525): """Embeds existing Plotly figure in IPython Notebook Plotly uniquely identifies figures with a 'file_owner'/'file_id' pair. Since each file is given a corresponding unique url, you may also simply pass a valid plotly url as the first argument. Note, if you're using a file_owner string as the first argument, you MUST specify a `file_id` keyword argument. Else, if you're using a url string as the first argument, you MUST NOT specify a `file_id` keyword argument, or file_id must be set to Python's None value. Positional arguments: file_owner_or_url (string) -- a valid plotly username OR a valid plotly url Keyword arguments: file_id (default=None) -- an int or string that can be converted to int if you're using a url, don't fill this in! width (default="100%") -- an int or string corresp. to width of the figure height (default="525") -- same as width but corresp. to the height of the figure """ try: s = get_embed(file_owner_or_url, file_id=file_id, width=width, height=height) # see if we are in the SageMath Cloud if sage_salvus: return sage_salvus.html(s, hide=False) except: pass if ipython_core_display: if file_id: plotly_domain = ( session.get_session_config().get('plotly_domain') or get_config_file()['plotly_domain'] ) url = "{plotly_domain}/~{un}/{fid}".format( plotly_domain=plotly_domain, un=file_owner_or_url, fid=file_id) else: url = file_owner_or_url return PlotlyDisplay(url, width, height) else: if (get_config_defaults()['plotly_domain'] != session.get_session_config()['plotly_domain']): feedback_contact = 'Visit support.plot.ly' else: # different domain likely means enterprise feedback_contact = 'Contact your On-Premise account executive' warnings.warn( "Looks like you're not using IPython or Sage to embed this " "plot. If you just want the *embed code*,\ntry using " "`get_embed()` instead." '\nQuestions? {}'.format(feedback_contact)) ### mpl-related tools ### @utils.template_doc(**get_config_file()) def mpl_to_plotly(fig, resize=False, strip_style=False, verbose=False): """Convert a matplotlib figure to plotly dictionary and send. All available information about matplotlib visualizations are stored within a matplotlib.figure.Figure object. You can create a plot in python using matplotlib, store the figure object, and then pass this object to the fig_to_plotly function. In the background, mplexporter is used to crawl through the mpl figure object for appropriate information. This information is then systematically sent to the PlotlyRenderer which creates the JSON structure used to make plotly visualizations. Finally, these dictionaries are sent to plotly and your browser should open up a new tab for viewing! Optionally, if you're working in IPython, you can set notebook=True and the PlotlyRenderer will call plotly.iplot instead of plotly.plot to have the graph appear directly in the IPython notebook. Note, this function gives the user access to a simple, one-line way to render an mpl figure in plotly. If you need to trouble shoot, you can do this step manually by NOT running this fuction and entereing the following: =========================================================================== from mplexporter import Exporter from mplexporter.renderers import PlotlyRenderer # create an mpl figure and store it under a varialble 'fig' renderer = PlotlyRenderer() exporter = Exporter(renderer) exporter.run(fig) =========================================================================== You can then inspect the JSON structures by accessing these: renderer.layout -- a plotly layout dictionary renderer.data -- a list of plotly data dictionaries Positional arguments: fig -- a matplotlib figure object username -- a valid plotly username ** api_key -- a valid api_key for the above username ** notebook -- an option for use with an IPython notebook ** Don't have a username/api_key? Try looking here: {plotly_domain}/plot ** Forgot your api_key? Try signing in and looking here: {plotly_domain}/python/getting-started """ if matplotlylib: renderer = matplotlylib.PlotlyRenderer() matplotlylib.Exporter(renderer).run(fig) if resize: renderer.resize() if strip_style: renderer.strip_style() if verbose: print(renderer.msg) return renderer.plotly_fig else: warnings.warn( "To use Plotly's matplotlylib functionality, you'll need to have " "matplotlib successfully installed with all of its dependencies. " "You're getting this error because matplotlib or one of its " "dependencies doesn't seem to be installed correctly.") ### graph_objs related tools ### def get_subplots(rows=1, columns=1, print_grid=False, **kwargs): """Return a dictionary instance with the subplots set in 'layout'. Example 1: # stack two subplots vertically fig = tools.get_subplots(rows=2) fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x1', yaxis='y1')] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x2', yaxis='y2')] Example 2: # print out string showing the subplot grid you've put in the layout fig = tools.get_subplots(rows=3, columns=2, print_grid=True) Keywords arguments with constant defaults: rows (kwarg, int greater than 0, default=1): Number of rows, evenly spaced vertically on the figure. columns (kwarg, int greater than 0, default=1): Number of columns, evenly spaced horizontally on the figure. horizontal_spacing (kwarg, float in [0,1], default=0.1): Space between subplot columns. Applied to all columns. vertical_spacing (kwarg, float in [0,1], default=0.05): Space between subplot rows. Applied to all rows. print_grid (kwarg, True | False, default=False): If True, prints a tab-delimited string representation of your plot grid. Keyword arguments with variable defaults: horizontal_spacing (kwarg, float in [0,1], default=0.2 / columns): Space between subplot columns. vertical_spacing (kwarg, float in [0,1], default=0.3 / rows): Space between subplot rows. """ # TODO: protected until #282 from plotly.graph_objs import graph_objs warnings.warn( "tools.get_subplots is depreciated. " "Please use tools.make_subplots instead." ) # Throw exception for non-integer rows and columns if not isinstance(rows, int) or rows <= 0: raise Exception("Keyword argument 'rows' " "must be an int greater than 0") if not isinstance(columns, int) or columns <= 0: raise Exception("Keyword argument 'columns' " "must be an int greater than 0") # Throw exception if non-valid kwarg is sent VALID_KWARGS = ['horizontal_spacing', 'vertical_spacing'] for key in kwargs.keys(): if key not in VALID_KWARGS: raise Exception("Invalid keyword argument: '{0}'".format(key)) # Set 'horizontal_spacing' / 'vertical_spacing' w.r.t. rows / columns try: horizontal_spacing = float(kwargs['horizontal_spacing']) except KeyError: horizontal_spacing = 0.2 / columns try: vertical_spacing = float(kwargs['vertical_spacing']) except KeyError: vertical_spacing = 0.3 / rows fig = dict(layout=graph_objs.Layout()) # will return this at the end plot_width = (1 - horizontal_spacing * (columns - 1)) / columns plot_height = (1 - vertical_spacing * (rows - 1)) / rows plot_num = 0 for rrr in range(rows): for ccc in range(columns): xaxis_name = 'xaxis{0}'.format(plot_num + 1) x_anchor = 'y{0}'.format(plot_num + 1) x_start = (plot_width + horizontal_spacing) * ccc x_end = x_start + plot_width yaxis_name = 'yaxis{0}'.format(plot_num + 1) y_anchor = 'x{0}'.format(plot_num + 1) y_start = (plot_height + vertical_spacing) * rrr y_end = y_start + plot_height xaxis = graph_objs.XAxis(domain=[x_start, x_end], anchor=x_anchor) fig['layout'][xaxis_name] = xaxis yaxis = graph_objs.YAxis(domain=[y_start, y_end], anchor=y_anchor) fig['layout'][yaxis_name] = yaxis plot_num += 1 if print_grid: print("This is the format of your plot grid!") grid_string = "" plot = 1 for rrr in range(rows): grid_line = "" for ccc in range(columns): grid_line += "[{0}]\t".format(plot) plot += 1 grid_string = grid_line + '\n' + grid_string print(grid_string) return graph_objs.Figure(fig) # forces us to validate what we just did... def make_subplots(rows=1, cols=1, shared_xaxes=False, shared_yaxes=False, start_cell='top-left', print_grid=True, **kwargs): """Return an instance of plotly.graph_objs.Figure with the subplots domain set in 'layout'. Example 1: # stack two subplots vertically fig = tools.make_subplots(rows=2) This is the format of your plot grid: [ (1,1) x1,y1 ] [ (2,1) x2,y2 ] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2])] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x2', yaxis='y2')] # or see Figure.append_trace Example 2: # subplots with shared x axes fig = tools.make_subplots(rows=2, shared_xaxes=True) This is the format of your plot grid: [ (1,1) x1,y1 ] [ (2,1) x1,y2 ] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2])] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], yaxis='y2')] Example 3: # irregular subplot layout (more examples below under 'specs') fig = tools.make_subplots(rows=2, cols=2, specs=[[{}, {}], [{'colspan': 2}, None]]) This is the format of your plot grid! [ (1,1) x1,y1 ] [ (1,2) x2,y2 ] [ (2,1) x3,y3 - ] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2])] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x2', yaxis='y2')] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x3', yaxis='y3')] Example 4: # insets fig = tools.make_subplots(insets=[{'cell': (1,1), 'l': 0.7, 'b': 0.3}]) This is the format of your plot grid! [ (1,1) x1,y1 ] With insets: [ x2,y2 ] over [ (1,1) x1,y1 ] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2])] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x2', yaxis='y2')] Example 5: # include subplot titles fig = tools.make_subplots(rows=2, subplot_titles=('Plot 1','Plot 2')) This is the format of your plot grid: [ (1,1) x1,y1 ] [ (2,1) x2,y2 ] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2])] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x2', yaxis='y2')] Example 6: # Include subplot title on one plot (but not all) fig = tools.make_subplots(insets=[{'cell': (1,1), 'l': 0.7, 'b': 0.3}], subplot_titles=('','Inset')) This is the format of your plot grid! [ (1,1) x1,y1 ] With insets: [ x2,y2 ] over [ (1,1) x1,y1 ] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2])] fig['data'] += [Scatter(x=[1,2,3], y=[2,1,2], xaxis='x2', yaxis='y2')] Keywords arguments with constant defaults: rows (kwarg, int greater than 0, default=1): Number of rows in the subplot grid. cols (kwarg, int greater than 0, default=1): Number of columns in the subplot grid. shared_xaxes (kwarg, boolean or list, default=False) Assign shared x axes. If True, subplots in the same grid column have one common shared x-axis at the bottom of the gird. To assign shared x axes per subplot grid cell (see 'specs'), send list (or list of lists, one list per shared x axis) of cell index tuples. shared_yaxes (kwarg, boolean or list, default=False) Assign shared y axes. If True, subplots in the same grid row have one common shared y-axis on the left-hand side of the gird. To assign shared y axes per subplot grid cell (see 'specs'), send list (or list of lists, one list per shared y axis) of cell index tuples. start_cell (kwarg, 'bottom-left' or 'top-left', default='top-left') Choose the starting cell in the subplot grid used to set the domains of the subplots. print_grid (kwarg, boolean, default=True): If True, prints a tab-delimited string representation of your plot grid. Keyword arguments with variable defaults: horizontal_spacing (kwarg, float in [0,1], default=0.2 / cols): Space between subplot columns. Applies to all columns (use 'specs' subplot-dependents spacing) vertical_spacing (kwarg, float in [0,1], default=0.3 / rows): Space between subplot rows. Applies to all rows (use 'specs' subplot-dependents spacing) subplot_titles (kwarg, list of strings, default=empty list): Title of each subplot. "" can be included in the list if no subplot title is desired in that space so that the titles are properly indexed. specs (kwarg, list of lists of dictionaries): Subplot specifications. ex1: specs=[[{}, {}], [{'colspan': 2}, None]] ex2: specs=[[{'rowspan': 2}, {}], [None, {}]] - Indices of the outer list correspond to subplot grid rows starting from the bottom. The number of rows in 'specs' must be equal to 'rows'. - Indices of the inner lists correspond to subplot grid columns starting from the left. The number of columns in 'specs' must be equal to 'cols'. - Each item in the 'specs' list corresponds to one subplot in a subplot grid. (N.B. The subplot grid has exactly 'rows' times 'cols' cells.) - Use None for blank a subplot cell (or to move pass a col/row span). - Note that specs[0][0] has the specs of the 'start_cell' subplot. - Each item in 'specs' is a dictionary. The available keys are: * is_3d (boolean, default=False): flag for 3d scenes * colspan (int, default=1): number of subplot columns for this subplot to span. * rowspan (int, default=1): number of subplot rows for this subplot to span. * l (float, default=0.0): padding left of cell * r (float, default=0.0): padding right of cell * t (float, default=0.0): padding right of cell * b (float, default=0.0): padding bottom of cell - Use 'horizontal_spacing' and 'vertical_spacing' to adjust the spacing in between the subplots. insets (kwarg, list of dictionaries): Inset specifications. - Each item in 'insets' is a dictionary. The available keys are: * cell (tuple, default=(1,1)): (row, col) index of the subplot cell to overlay inset axes onto. * is_3d (boolean, default=False): flag for 3d scenes * l (float, default=0.0): padding left of inset in fraction of cell width * w (float or 'to_end', default='to_end') inset width in fraction of cell width ('to_end': to cell right edge) * b (float, default=0.0): padding bottom of inset in fraction of cell height * h (float or 'to_end', default='to_end') inset height in fraction of cell height ('to_end': to cell top edge) column_width (kwarg, list of numbers) Column_width specifications - Functions similarly to `column_width` of `plotly.graph_objs.Table`. Specify a list that contains numbers where the amount of numbers in the list is equal to `cols`. - The numbers in the list indicate the proportions that each column domains take across the full horizontal domain excluding padding. - For example, if columns_width=[3, 1], horizontal_spacing=0, and cols=2, the domains for each column would be [0. 0.75] and [0.75, 1] row_width (kwargs, list of numbers) Row_width specifications - Functions similarly to `column_width`. Specify a list that contains numbers where the amount of numbers in the list is equal to `rows`. - The numbers in the list indicate the proportions that each row domains take along the full vertical domain excluding padding. - For example, if row_width=[3, 1], vertical_spacing=0, and cols=2, the domains for each row from top to botton would be [0. 0.75] and [0.75, 1] """ # TODO: protected until #282 from plotly.graph_objs import graph_objs # Throw exception for non-integer rows and cols if not isinstance(rows, int) or rows <= 0: raise Exception("Keyword argument 'rows' " "must be an int greater than 0") if not isinstance(cols, int) or cols <= 0: raise Exception("Keyword argument 'cols' " "must be an int greater than 0") # Dictionary of things start_cell START_CELL_all = { 'bottom-left': { # 'natural' setup where x & y domains increase monotonically 'col_dir': 1, 'row_dir': 1 }, 'top-left': { # 'default' setup visually matching the 'specs' list of lists 'col_dir': 1, 'row_dir': -1 } # TODO maybe add 'bottom-right' and 'top-right' } # Throw exception for invalid 'start_cell' values try: START_CELL = START_CELL_all[start_cell] except KeyError: raise Exception("Invalid 'start_cell' value") # Throw exception if non-valid kwarg is sent VALID_KWARGS = ['horizontal_spacing', 'vertical_spacing', 'specs', 'insets', 'subplot_titles', 'column_width', 'row_width'] for key in kwargs.keys(): if key not in VALID_KWARGS: raise Exception("Invalid keyword argument: '{0}'".format(key)) # Set 'subplot_titles' subplot_titles = kwargs.get('subplot_titles', [""] * rows * cols) # Set 'horizontal_spacing' / 'vertical_spacing' w.r.t. rows / cols try: horizontal_spacing = float(kwargs['horizontal_spacing']) except KeyError: horizontal_spacing = 0.2 / cols try: vertical_spacing = float(kwargs['vertical_spacing']) except KeyError: if 'subplot_titles' in kwargs: vertical_spacing = 0.5 / rows else: vertical_spacing = 0.3 / rows # Sanitize 'specs' (must be a list of lists) exception_msg = "Keyword argument 'specs' must be a list of lists" try: specs = kwargs['specs'] if not isinstance(specs, list): raise Exception(exception_msg) else: for spec_row in specs: if not isinstance(spec_row, list): raise Exception(exception_msg) except KeyError: specs = [[{} for c in range(cols)] for r in range(rows)] # default 'specs' # Throw exception if specs is over or under specified if len(specs) != rows: raise Exception("The number of rows in 'specs' " "must be equal to 'rows'") for r, spec_row in enumerate(specs): if len(spec_row) != cols: raise Exception("The number of columns in 'specs' " "must be equal to 'cols'") # Sanitize 'insets' try: insets = kwargs['insets'] if not isinstance(insets, list): raise Exception("Keyword argument 'insets' must be a list") except KeyError: insets = False # Throw exception if non-valid key / fill in defaults def _check_keys_and_fill(name, arg, defaults): def _checks(item, defaults): if item is None: return if not isinstance(item, dict): raise Exception("Items in keyword argument '{name}' must be " "dictionaries or None".format(name=name)) for k in item.keys(): if k not in defaults.keys(): raise Exception("Invalid key '{k}' in keyword " "argument '{name}'".format(k=k, name=name)) for k in defaults.keys(): if k not in item.keys(): item[k] = defaults[k] for arg_i in arg: if isinstance(arg_i, list): for arg_ii in arg_i: _checks(arg_ii, defaults) elif isinstance(arg_i, dict): _checks(arg_i, defaults) # Default spec key-values SPEC_defaults = dict( is_3d=False, colspan=1, rowspan=1, l=0.0, r=0.0, b=0.0, t=0.0 # TODO add support for 'w' and 'h' ) _check_keys_and_fill('specs', specs, SPEC_defaults) # Default inset key-values if insets: INSET_defaults = dict( cell=(1, 1), is_3d=False, l=0.0, w='to_end', b=0.0, h='to_end' ) _check_keys_and_fill('insets', insets, INSET_defaults) # set heights (with 'column_width') try: column_width = kwargs['column_width'] if not isinstance(column_width, list) or len(column_width) != cols: raise Exception( "Keyword argument 'column_width' must be a list with {} " "numbers in it, the number of subplot cols.".format(cols) ) except KeyError: column_width = None if column_width: cum_sum = float(sum(column_width)) widths = [] for w in column_width: widths.append( (1. - horizontal_spacing * (cols - 1)) * (w / cum_sum) ) else: widths = [(1. - horizontal_spacing * (cols - 1)) / cols] * cols # set widths (with 'row_width') try: row_width = kwargs['row_width'] if not isinstance(row_width, list) or len(row_width) != rows: raise Exception( "Keyword argument 'row_width' must be a list with {} " "numbers in it, the number of subplot rows.".format(rows) ) except KeyError: row_width = None if row_width: cum_sum = float(sum(row_width)) heights = [] for h in row_width: heights.append( (1. - vertical_spacing * (rows - 1)) * (h / cum_sum) ) else: heights = [(1. - vertical_spacing * (rows - 1)) / rows] * rows # Built row/col sequence using 'row_dir' and 'col_dir' COL_DIR = START_CELL['col_dir'] ROW_DIR = START_CELL['row_dir'] col_seq = range(cols)[::COL_DIR] row_seq = range(rows)[::ROW_DIR] # [grid] Build subplot grid (coord tuple of cell) grid = [ [ ( (sum(widths[:c]) + c * horizontal_spacing), (sum(heights[:r]) + r * vertical_spacing) ) for c in col_seq ] for r in row_seq ] # [grid_ref] Initialize the grid and insets' axis-reference lists grid_ref = [[None for c in range(cols)] for r in range(rows)] insets_ref = [None for inset in range(len(insets))] if insets else None layout = graph_objs.Layout() # init layout object # Function handling logic around 2d axis labels # Returns 'x{}' | 'y{}' def _get_label(x_or_y, r, c, cnt, shared_axes): # Default label (given strictly by cnt) label = "{x_or_y}{cnt}".format(x_or_y=x_or_y, cnt=cnt) if isinstance(shared_axes, bool): if shared_axes: if x_or_y == 'x': label = "{x_or_y}{c}".format(x_or_y=x_or_y, c=c + 1) if x_or_y == 'y': label = "{x_or_y}{r}".format(x_or_y=x_or_y, r=r + 1) if isinstance(shared_axes, list): if isinstance(shared_axes[0], tuple): shared_axes = [shared_axes] # TODO put this elsewhere for shared_axis in shared_axes: if (r + 1, c + 1) in shared_axis: label = { 'x': "x{0}".format(shared_axis[0][1]), 'y': "y{0}".format(shared_axis[0][0]) }[x_or_y] return label # Row in grid of anchor row if shared_xaxes=True ANCHOR_ROW = 0 if ROW_DIR > 0 else rows - 1 # Function handling logic around 2d axis anchors # Return 'x{}' | 'y{}' | 'free' | False def _get_anchors(r, c, x_cnt, y_cnt, shared_xaxes, shared_yaxes): # Default anchors (give strictly by cnt) x_anchor = "y{y_cnt}".format(y_cnt=y_cnt) y_anchor = "x{x_cnt}".format(x_cnt=x_cnt) if isinstance(shared_xaxes, bool): if shared_xaxes: if r != ANCHOR_ROW: x_anchor = False y_anchor = 'free' if shared_yaxes and c != 0: # TODO covers all cases? y_anchor = False return x_anchor, y_anchor elif isinstance(shared_xaxes, list): if isinstance(shared_xaxes[0], tuple): shared_xaxes = [shared_xaxes] # TODO put this elsewhere for shared_xaxis in shared_xaxes: if (r + 1, c + 1) in shared_xaxis[1:]: x_anchor = False y_anchor = 'free' # TODO covers all cases? if isinstance(shared_yaxes, bool): if shared_yaxes: if c != 0: y_anchor = False x_anchor = 'free' if shared_xaxes and r != ANCHOR_ROW: # TODO all cases? x_anchor = False return x_anchor, y_anchor elif isinstance(shared_yaxes, list): if isinstance(shared_yaxes[0], tuple): shared_yaxes = [shared_yaxes] # TODO put this elsewhere for shared_yaxis in shared_yaxes: if (r + 1, c + 1) in shared_yaxis[1:]: y_anchor = False x_anchor = 'free' # TODO covers all cases? return x_anchor, y_anchor list_of_domains = [] # added for subplot titles # Function pasting x/y domains in layout object (2d case) def _add_domain(layout, x_or_y, label, domain, anchor, position): name = label[0] + 'axis' + label[1:] axis = {'domain': domain} if anchor: axis['anchor'] = anchor if isinstance(position, float): axis['position'] = position layout[name] = axis list_of_domains.append(domain) # added for subplot titles # Function pasting x/y domains in layout object (3d case) def _add_domain_is_3d(layout, s_label, x_domain, y_domain): scene = graph_objs.Scene(domain={'x': x_domain, 'y': y_domain}) layout[s_label] = scene x_cnt = y_cnt = s_cnt = 1 # subplot axis/scene counters # Loop through specs -- (r, c) <-> (row, col) for r, spec_row in enumerate(specs): for c, spec in enumerate(spec_row): if spec is None: # skip over None cells continue c_spanned = c + spec['colspan'] - 1 # get spanned c r_spanned = r + spec['rowspan'] - 1 # get spanned r # Throw exception if 'colspan' | 'rowspan' is too large for grid if c_spanned >= cols: raise Exception("Some 'colspan' value is too large for " "this subplot grid.") if r_spanned >= rows: raise Exception("Some 'rowspan' value is too large for " "this subplot grid.") # Get x domain using grid and colspan x_s = grid[r][c][0] + spec['l'] x_e = grid[r][c_spanned][0] + widths[c] - spec['r'] x_domain = [x_s, x_e] # Get y domain (dep. on row_dir) using grid & r_spanned if ROW_DIR > 0: y_s = grid[r][c][1] + spec['b'] y_e = grid[r_spanned][c][1] + heights[-1 - r] - spec['t'] else: y_s = grid[r_spanned][c][1] + spec['b'] y_e = grid[r][c][1] + heights[-1 - r] - spec['t'] y_domain = [y_s, y_e] if spec['is_3d']: # Add scene to layout s_label = 'scene{0}'.format(s_cnt) _add_domain_is_3d(layout, s_label, x_domain, y_domain) grid_ref[r][c] = (s_label, ) s_cnt += 1 else: # Get axis label and anchor x_label = _get_label('x', r, c, x_cnt, shared_xaxes) y_label = _get_label('y', r, c, y_cnt, shared_yaxes) x_anchor, y_anchor = _get_anchors(r, c, x_cnt, y_cnt, shared_xaxes, shared_yaxes) # Add a xaxis to layout (N.B anchor == False -> no axis) if x_anchor: if x_anchor == 'free': x_position = y_domain[0] else: x_position = False _add_domain(layout, 'x', x_label, x_domain, x_anchor, x_position) x_cnt += 1 # Add a yaxis to layout (N.B anchor == False -> no axis) if y_anchor: if y_anchor == 'free': y_position = x_domain[0] else: y_position = False _add_domain(layout, 'y', y_label, y_domain, y_anchor, y_position) y_cnt += 1 grid_ref[r][c] = (x_label, y_label) # fill in ref # Loop through insets if insets: for i_inset, inset in enumerate(insets): r = inset['cell'][0] - 1 c = inset['cell'][1] - 1 # Throw exception if r | c is out of range if not (0 <= r < rows): raise Exception("Some 'cell' row value is out of range. " "Note: the starting cell is (1, 1)") if not (0 <= c < cols): raise Exception("Some 'cell' col value is out of range. " "Note: the starting cell is (1, 1)") # Get inset x domain using grid x_s = grid[r][c][0] + inset['l'] * widths[c] if inset['w'] == 'to_end': x_e = grid[r][c][0] + widths[c] else: x_e = x_s + inset['w'] * widths[c] x_domain = [x_s, x_e] # Get inset y domain using grid y_s = grid[r][c][1] + inset['b'] * heights[-1 - r] if inset['h'] == 'to_end': y_e = grid[r][c][1] + heights[-1 - r] else: y_e = y_s + inset['h'] * heights[-1 - r] y_domain = [y_s, y_e] if inset['is_3d']: # Add scene to layout s_label = 'scene{0}'.format(s_cnt) _add_domain_is_3d(layout, s_label, x_domain, y_domain) insets_ref[i_inset] = (s_label, ) s_cnt += 1 else: # Get axis label and anchor x_label = _get_label('x', False, False, x_cnt, False) y_label = _get_label('y', False, False, y_cnt, False) x_anchor, y_anchor = _get_anchors(r, c, x_cnt, y_cnt, False, False) # Add a xaxis to layout (N.B insets always have anchors) _add_domain(layout, 'x', x_label, x_domain, x_anchor, False) x_cnt += 1 # Add a yayis to layout (N.B insets always have anchors) _add_domain(layout, 'y', y_label, y_domain, y_anchor, False) y_cnt += 1 insets_ref[i_inset] = (x_label, y_label) # fill in ref # [grid_str] Set the grid's string representation sp = " " # space between cell s_str = "[ " # cell start string e_str = " ]" # cell end string colspan_str = ' -' # colspan string rowspan_str = ' |' # rowspan string empty_str = ' (empty) ' # empty cell string # Init grid_str with intro message grid_str = "This is the format of your plot grid:\n" # Init tmp list of lists of strings (sorta like 'grid_ref' but w/ strings) _tmp = [['' for c in range(cols)] for r in range(rows)] # Define cell string as function of (r, c) and grid_ref def _get_cell_str(r, c, ref): return '({r},{c}) {ref}'.format(r=r + 1, c=c + 1, ref=','.join(ref)) # Find max len of _cell_str, add define a padding function cell_len = max([len(_get_cell_str(r, c, ref)) for r, row_ref in enumerate(grid_ref) for c, ref in enumerate(row_ref) if ref]) + len(s_str) + len(e_str) def _pad(s, cell_len=cell_len): return ' ' * (cell_len - len(s)) # Loop through specs, fill in _tmp for r, spec_row in enumerate(specs): for c, spec in enumerate(spec_row): ref = grid_ref[r][c] if ref is None: if _tmp[r][c] == '': _tmp[r][c] = empty_str + _pad(empty_str) continue cell_str = s_str + _get_cell_str(r, c, ref) if spec['colspan'] > 1: for cc in range(1, spec['colspan'] - 1): _tmp[r][c + cc] = colspan_str + _pad(colspan_str) _tmp[r][c + spec['colspan'] - 1] = ( colspan_str + _pad(colspan_str + e_str)) + e_str else: cell_str += e_str if spec['rowspan'] > 1: for rr in range(1, spec['rowspan'] - 1): _tmp[r + rr][c] = rowspan_str + _pad(rowspan_str) for cc in range(spec['colspan']): _tmp[r + spec['rowspan'] - 1][c + cc] = ( rowspan_str + _pad(rowspan_str)) _tmp[r][c] = cell_str + _pad(cell_str) # Append grid_str using data from _tmp in the correct order for r in row_seq[::-1]: grid_str += sp.join(_tmp[r]) + '\n' # Append grid_str to include insets info if insets: grid_str += "\nWith insets:\n" for i_inset, inset in enumerate(insets): r = inset['cell'][0] - 1 c = inset['cell'][1] - 1 ref = grid_ref[r][c] grid_str += ( s_str + ','.join(insets_ref[i_inset]) + e_str + ' over ' + s_str + _get_cell_str(r, c, ref) + e_str + '\n' ) # Add subplot titles # If shared_axes is False (default) use list_of_domains # This is used for insets and irregular layouts if not shared_xaxes and not shared_yaxes: x_dom = list_of_domains[::2] y_dom = list_of_domains[1::2] subtitle_pos_x = [] subtitle_pos_y = [] for x_domains in x_dom: subtitle_pos_x.append(sum(x_domains) / 2) for y_domains in y_dom: subtitle_pos_y.append(y_domains[1]) # If shared_axes is True the domin of each subplot is not returned so the # title position must be calculated for each subplot else: subtitle_pos_x = [None] * cols subtitle_pos_y = [None] * rows delt_x = (x_e - x_s) for index in range(cols): subtitle_pos_x[index] = ((delt_x / 2) + ((delt_x + horizontal_spacing) * index)) subtitle_pos_x *= rows for index in range(rows): subtitle_pos_y[index] = (1 - ((y_e + vertical_spacing) * index)) subtitle_pos_y *= cols subtitle_pos_y = sorted(subtitle_pos_y, reverse=True) plot_titles = [] for index in range(len(subplot_titles)): if not subplot_titles[index]: pass else: plot_titles.append({'y': subtitle_pos_y[index], 'xref': 'paper', 'x': subtitle_pos_x[index], 'yref': 'paper', 'text': subplot_titles[index], 'showarrow': False, 'font': graph_objs.Font(size=16), 'xanchor': 'center', 'yanchor': 'bottom' }) layout['annotations'] = plot_titles if print_grid: print(grid_str) fig = graph_objs.Figure(layout=layout) fig.__dict__['_grid_ref'] = grid_ref fig.__dict__['_grid_str'] = grid_str return fig def get_valid_graph_obj(obj, obj_type=None): """Returns a new graph object that won't raise. CAREFUL: this will *silently* strip out invalid pieces of the object. """ # TODO: Deprecate or move. #283 from plotly.graph_objs import graph_objs try: cls = getattr(graph_objs, obj_type) except (AttributeError, KeyError): raise exceptions.PlotlyError( "'{}' is not a recognized graph_obj.".format(obj_type) ) return cls(obj, _raise=False) def validate(obj, obj_type): """Validate a dictionary, list, or graph object as 'obj_type'. This will not alter the 'obj' referenced in the call signature. It will raise an error if the 'obj' reference could not be instantiated as a valid 'obj_type' graph object. """ # TODO: Deprecate or move. #283 from plotly import graph_reference from plotly.graph_objs import graph_objs if obj_type not in graph_reference.CLASSES: obj_type = graph_reference.string_to_class_name(obj_type) try: cls = getattr(graph_objs, obj_type) except AttributeError: raise exceptions.PlotlyError( "'{0}' is not a recognizable graph_obj.". format(obj_type)) cls(obj) # this will raise on invalid keys/items def _replace_newline(obj): """Replaces '\n' with '
' for all strings in a collection.""" if isinstance(obj, dict): d = dict() for key, val in list(obj.items()): d[key] = _replace_newline(val) return d elif isinstance(obj, list): l = list() for index, entry in enumerate(obj): l += [_replace_newline(entry)] return l elif isinstance(obj, six.string_types): s = obj.replace('\n', '
') if s != obj: warnings.warn("Looks like you used a newline character: '\\n'.\n\n" "Plotly uses a subset of HTML escape characters\n" "to do things like newline (
), bold (),\n" "italics (), etc. Your newline characters \n" "have been converted to '
' so they will show \n" "up right on your Plotly figure!") return s else: return obj # we return the actual reference... but DON'T mutate. if ipython_core_display: class PlotlyDisplay(ipython_core_display.HTML): """An IPython display object for use with plotly urls PlotlyDisplay objects should be instantiated with a url for a plot. IPython will *choose* the proper display representation from any Python object, and using provided methods if they exist. By defining the following, if an HTML display is unusable, the PlotlyDisplay object can provide alternate representations. """ def __init__(self, url, width, height): self.resource = url self.embed_code = get_embed(url, width=width, height=height) super(PlotlyDisplay, self).__init__(data=self.embed_code) def _repr_html_(self): return self.embed_code def return_figure_from_figure_or_data(figure_or_data, validate_figure): from plotly.graph_objs import graph_objs if isinstance(figure_or_data, dict): figure = figure_or_data elif isinstance(figure_or_data, list): figure = {'data': figure_or_data} else: raise exceptions.PlotlyError("The `figure_or_data` positional " "argument must be either " "`dict`-like or `list`-like.") if validate_figure: try: graph_objs.Figure(figure) except exceptions.PlotlyError as err: raise exceptions.PlotlyError("Invalid 'figure_or_data' argument. " "Plotly will not be able to properly " "parse the resulting JSON. If you " "want to send this 'figure_or_data' " "to Plotly anyway (not recommended), " "you can set 'validate=False' as a " "plot option.\nHere's why you're " "seeing this error:\n\n{0}" "".format(err)) if not figure['data']: raise exceptions.PlotlyEmptyDataError( "Empty data list found. Make sure that you populated the " "list of data objects you're sending and try again.\n" "Questions? Visit support.plot.ly" ) return figure # Default colours for finance charts _DEFAULT_INCREASING_COLOR = '#3D9970' # http://clrs.cc _DEFAULT_DECREASING_COLOR = '#FF4136' DIAG_CHOICES = ['scatter', 'histogram', 'box'] VALID_COLORMAP_TYPES = ['cat', 'seq'] class FigureFactory(object): @staticmethod def _deprecated(old_method, new_method=None): if new_method is None: # The method name stayed the same. new_method = old_method warnings.warn( 'plotly.tools.FigureFactory.{} is deprecated. ' 'Use plotly.figure_factory.{}'.format(old_method, new_method) ) @staticmethod def create_2D_density(*args, **kwargs): FigureFactory._deprecated('create_2D_density', 'create_2d_density') from plotly.figure_factory import create_2d_density return create_2d_density(*args, **kwargs) @staticmethod def create_annotated_heatmap(*args, **kwargs): FigureFactory._deprecated('create_annotated_heatmap') from plotly.figure_factory import create_annotated_heatmap return create_annotated_heatmap(*args, **kwargs) @staticmethod def create_candlestick(*args, **kwargs): FigureFactory._deprecated('create_candlestick') from plotly.figure_factory import create_candlestick return create_candlestick(*args, **kwargs) @staticmethod def create_dendrogram(*args, **kwargs): FigureFactory._deprecated('create_dendrogram') from plotly.figure_factory import create_dendrogram return create_dendrogram(*args, **kwargs) @staticmethod def create_distplot(*args, **kwargs): FigureFactory._deprecated('create_distplot') from plotly.figure_factory import create_distplot return create_distplot(*args, **kwargs) @staticmethod def create_facet_grid(*args, **kwargs): FigureFactory._deprecated('create_facet_grid') from plotly.figure_factory import create_facet_grid return create_facet_grid(*args, **kwargs) @staticmethod def create_gantt(*args, **kwargs): FigureFactory._deprecated('create_gantt') from plotly.figure_factory import create_gantt return create_gantt(*args, **kwargs) @staticmethod def create_ohlc(*args, **kwargs): FigureFactory._deprecated('create_ohlc') from plotly.figure_factory import create_ohlc return create_ohlc(*args, **kwargs) @staticmethod def create_quiver(*args, **kwargs): FigureFactory._deprecated('create_quiver') from plotly.figure_factory import create_quiver return create_quiver(*args, **kwargs) @staticmethod def create_scatterplotmatrix(*args, **kwargs): FigureFactory._deprecated('create_scatterplotmatrix') from plotly.figure_factory import create_scatterplotmatrix return create_scatterplotmatrix(*args, **kwargs) @staticmethod def create_streamline(*args, **kwargs): FigureFactory._deprecated('create_streamline') from plotly.figure_factory import create_streamline return create_streamline(*args, **kwargs) @staticmethod def create_table(*args, **kwargs): FigureFactory._deprecated('create_table') from plotly.figure_factory import create_table return create_table(*args, **kwargs) @staticmethod def create_trisurf(*args, **kwargs): FigureFactory._deprecated('create_trisurf') from plotly.figure_factory import create_trisurf return create_trisurf(*args, **kwargs) @staticmethod def create_violin(*args, **kwargs): FigureFactory._deprecated('create_violin') from plotly.figure_factory import create_violin return create_violin(*args, **kwargs) plotly-2.2.3+dfsg.orig/plotly/config.py0000644000175000017500000000220613104403274017407 0ustar noahfxnoahfx""" Merges and prioritizes file/session config and credentials. This is promoted to its own module to simplify imports. """ from __future__ import absolute_import from plotly import session, tools def get_credentials(): """Returns the credentials that will be sent to plotly.""" credentials = tools.get_credentials_file() session_credentials = session.get_session_credentials() for credentials_key in credentials: # checking for not false, but truthy value here is the desired behavior session_value = session_credentials.get(credentials_key) if session_value is False or session_value: credentials[credentials_key] = session_value return credentials def get_config(): """Returns either module config or file config.""" config = tools.get_config_file() session_config = session.get_session_config() for config_key in config: # checking for not false, but truthy value here is the desired behavior session_value = session_config.get(config_key) if session_value is False or session_value: config[config_key] = session_value return config plotly-2.2.3+dfsg.orig/plotly/version.py0000644000175000017500000000002613211605455017631 0ustar noahfxnoahfx__version__ = '2.2.3' plotly-2.2.3+dfsg.orig/plotly/api/0000755000175000017500000000000013211605515016342 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/api/utils.py0000644000175000017500000000207413104403274020056 0ustar noahfxnoahfxfrom base64 import b64encode from requests.compat import builtin_str, is_py2 def _to_native_string(string, encoding): if isinstance(string, builtin_str): return string if is_py2: return string.encode(encoding) return string.decode(encoding) def to_native_utf8_string(string): return _to_native_string(string, 'utf-8') def to_native_ascii_string(string): return _to_native_string(string, 'ascii') def basic_auth(username, password): """ Creates the basic auth value to be used in an authorization header. This is mostly copied from the requests library. :param (str) username: A Plotly username. :param (str) password: The password for the given Plotly username. :returns: (str) An 'authorization' header for use in a request header. """ if isinstance(username, str): username = username.encode('latin1') if isinstance(password, str): password = password.encode('latin1') return 'Basic ' + to_native_ascii_string( b64encode(b':'.join((username, password))).strip() ) plotly-2.2.3+dfsg.orig/plotly/api/v1/0000755000175000017500000000000013211605515016670 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/api/v1/utils.py0000644000175000017500000000564313104403274020411 0ustar noahfxnoahfxfrom __future__ import absolute_import import requests from requests.exceptions import RequestException from plotly import config, exceptions from plotly.api.utils import basic_auth def validate_response(response): """ Raise a helpful PlotlyRequestError for failed requests. :param (requests.Response) response: A Response object from an api request. :raises: (PlotlyRequestError) If the request failed for any reason. :returns: (None) """ content = response.content status_code = response.status_code try: parsed_content = response.json() except ValueError: message = content if content else 'No Content' raise exceptions.PlotlyRequestError(message, status_code, content) message = '' if isinstance(parsed_content, dict): error = parsed_content.get('error') if error: message = error else: if response.ok: return if not message: message = content if content else 'No Content' raise exceptions.PlotlyRequestError(message, status_code, content) def get_headers(): """ Using session credentials/config, get headers for a v1 API request. Users may have their own proxy layer and so we free up the `authorization` header for this purpose (instead adding the user authorization in a new `plotly-authorization` header). See pull #239. :returns: (dict) Headers to add to a requests.request call. """ headers = {} creds = config.get_credentials() proxy_auth = basic_auth(creds['proxy_username'], creds['proxy_password']) if config.get_config()['plotly_proxy_authorization']: headers['authorization'] = proxy_auth return headers def request(method, url, **kwargs): """ Central place to make any v1 api request. :param (str) method: The request method ('get', 'put', 'delete', ...). :param (str) url: The full api url to make the request to. :param kwargs: These are passed along to requests. :return: (requests.Response) The response directly from requests. """ if kwargs.get('json', None) is not None: # See plotly.api.v2.utils.request for examples on how to do this. raise exceptions.PlotlyError('V1 API does not handle arbitrary json.') kwargs['headers'] = dict(kwargs.get('headers', {}), **get_headers()) kwargs['verify'] = config.get_config()['plotly_ssl_verification'] try: response = requests.request(method, url, **kwargs) except RequestException as e: # The message can be an exception. E.g., MaxRetryError. message = str(getattr(e, 'message', 'No message')) response = getattr(e, 'response', None) status_code = response.status_code if response else None content = response.content if response else 'No content' raise exceptions.PlotlyRequestError(message, status_code, content) validate_response(response) return response plotly-2.2.3+dfsg.orig/plotly/api/v1/clientresp.py0000644000175000017500000000246413104403274021417 0ustar noahfxnoahfx"""Interface to deprecated /clientresp API. Subject to deletion.""" from __future__ import absolute_import import warnings from requests.compat import json as _json from plotly import config, utils, version from plotly.api.v1.utils import request def clientresp(data, **kwargs): """ Deprecated endpoint, still used because it can parse data out of a plot. When we get around to forcing users to create grids and then create plots, we can finally get rid of this. :param (list) data: The data array from a figure. """ creds = config.get_credentials() cfg = config.get_config() dumps_kwargs = {'sort_keys': True, 'cls': utils.PlotlyJSONEncoder} payload = { 'platform': 'python', 'version': version.__version__, 'args': _json.dumps(data, **dumps_kwargs), 'un': creds['username'], 'key': creds['api_key'], 'origin': 'plot', 'kwargs': _json.dumps(kwargs, **dumps_kwargs) } url = '{plotly_domain}/clientresp'.format(**cfg) response = request('post', url, data=payload) # Old functionality, just keeping it around. parsed_content = response.json() if parsed_content.get('warning'): warnings.warn(parsed_content['warning']) if parsed_content.get('message'): print(parsed_content['message']) return response plotly-2.2.3+dfsg.orig/plotly/api/v1/__init__.py0000644000175000017500000000013013104403274020772 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly.api.v1.clientresp import clientresp plotly-2.2.3+dfsg.orig/plotly/api/v2/0000755000175000017500000000000013211605515016671 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/api/v2/spectacle_presentations.py0000644000175000017500000000135013174436015024170 0ustar noahfxnoahfx""" Interface to Plotly's /v2/spectacle-presentations endpoint. """ from __future__ import absolute_import from plotly.api.v2.utils import build_url, request RESOURCE = 'spectacle-presentations' def create(body): """Create a presentation.""" url = build_url(RESOURCE) return request('post', url, json=body) def list(): """Returns the list of all users' presentations.""" url = build_url(RESOURCE) return request('get', url) def retrieve(fid): """Retrieve a presentation from Plotly.""" url = build_url(RESOURCE, id=fid) return request('get', url) def update(fid, content): """Completely update the writable.""" url = build_url(RESOURCE, id=fid) return request('put', url, json=content) plotly-2.2.3+dfsg.orig/plotly/api/v2/plots.py0000644000175000017500000001000013104403274020372 0ustar noahfxnoahfx"""Interface to Plotly's /v2/plots endpoints.""" from __future__ import absolute_import from plotly.api.v2.utils import build_url, make_params, request RESOURCE = 'plots' def create(body): """ Create a new plot. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE) return request('post', url, json=body) def retrieve(fid, share_key=None): """ Retrieve a plot from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) share_key: The secret key granting 'read' access if private. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) params = make_params(share_key=share_key) return request('get', url, params=params) def content(fid, share_key=None, inline_data=None, map_data=None): """ Retrieve the *figure* for a Plotly plot file. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) share_key: The secret key granting 'read' access if private. :param (bool) inline_data: If True, include the data arrays with the plot. :param (str) map_data: Currently only accepts 'unreadable' to return a mapping of grid-fid: grid. This is useful if you want to maintain structure between the plot and referenced grids when you have READ access to the plot, but you don't have READ access to the underlying grids. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='content') params = make_params(share_key=share_key, inline_data=inline_data, map_data=map_data) return request('get', url, params=params) def update(fid, body): """ Update a plot from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) return request('put', url, json=body) def trash(fid): """ Soft-delete a plot from Plotly. (Can be undone with 'restore'). :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='trash') return request('post', url) def restore(fid): """ Restore a trashed plot from Plotly. See 'trash'. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='restore') return request('post', url) def permanent_delete(fid, params=None): """ Permanently delete a trashed plot file from Plotly. See 'trash'. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='permanent_delete') return request('delete', url, params=params) def lookup(path, parent=None, user=None, exists=None): """ Retrieve a plot file from Plotly without needing a fid. :param (str) path: The '/'-delimited path specifying the file location. :param (int) parent: Parent id, an integer, which the path is relative to. :param (str) user: The username to target files for. Defaults to requestor. :param (bool) exists: If True, don't return the full file, just a flag. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, route='lookup') params = make_params(path=path, parent=parent, user=user, exists=exists) return request('get', url, params=params) plotly-2.2.3+dfsg.orig/plotly/api/v2/utils.py0000644000175000017500000001253213104403274020405 0ustar noahfxnoahfxfrom __future__ import absolute_import import requests from requests.compat import json as _json from requests.exceptions import RequestException from plotly import config, exceptions, version, utils from plotly.api.utils import basic_auth def make_params(**kwargs): """ Helper to create a params dict, skipping undefined entries. :returns: (dict) A params dict to pass to `request`. """ return {k: v for k, v in kwargs.items() if v is not None} def build_url(resource, id='', route=''): """ Create a url for a request on a V2 resource. :param (str) resource: E.g., 'files', 'plots', 'grids', etc. :param (str) id: The unique identifier for the resource. :param (str) route: Detail/list route. E.g., 'restore', 'lookup', etc. :return: (str) The url. """ base = config.get_config()['plotly_api_domain'] formatter = {'base': base, 'resource': resource, 'id': id, 'route': route} # Add path to base url depending on the input params. Note that `route` # can refer to a 'list' or a 'detail' route. Since it cannot refer to # both at the same time, it's overloaded in this function. if id: if route: url = '{base}/v2/{resource}/{id}/{route}'.format(**formatter) else: url = '{base}/v2/{resource}/{id}'.format(**formatter) else: if route: url = '{base}/v2/{resource}/{route}'.format(**formatter) else: url = '{base}/v2/{resource}'.format(**formatter) return url def validate_response(response): """ Raise a helpful PlotlyRequestError for failed requests. :param (requests.Response) response: A Response object from an api request. :raises: (PlotlyRequestError) If the request failed for any reason. :returns: (None) """ if response.ok: return content = response.content status_code = response.status_code try: parsed_content = response.json() except ValueError: message = content if content else 'No Content' raise exceptions.PlotlyRequestError(message, status_code, content) message = '' if isinstance(parsed_content, dict): errors = parsed_content.get('errors', []) messages = [error.get('message') for error in errors] message = '\n'.join([msg for msg in messages if msg]) if not message: message = content if content else 'No Content' raise exceptions.PlotlyRequestError(message, status_code, content) def get_headers(): """ Using session credentials/config, get headers for a V2 API request. Users may have their own proxy layer and so we free up the `authorization` header for this purpose (instead adding the user authorization in a new `plotly-authorization` header). See pull #239. :returns: (dict) Headers to add to a requests.request call. """ creds = config.get_credentials() headers = { 'plotly-client-platform': 'python {}'.format(version.__version__), 'content-type': 'application/json' } plotly_auth = basic_auth(creds['username'], creds['api_key']) proxy_auth = basic_auth(creds['proxy_username'], creds['proxy_password']) if config.get_config()['plotly_proxy_authorization']: headers['authorization'] = proxy_auth if creds['username'] and creds['api_key']: headers['plotly-authorization'] = plotly_auth else: if creds['username'] and creds['api_key']: headers['authorization'] = plotly_auth return headers def request(method, url, **kwargs): """ Central place to make any api v2 api request. :param (str) method: The request method ('get', 'put', 'delete', ...). :param (str) url: The full api url to make the request to. :param kwargs: These are passed along (but possibly mutated) to requests. :return: (requests.Response) The response directly from requests. """ kwargs['headers'] = dict(kwargs.get('headers', {}), **get_headers()) # Change boolean params to lowercase strings. E.g., `True` --> `'true'`. # Just change the value so that requests handles query string creation. if isinstance(kwargs.get('params'), dict): kwargs['params'] = kwargs['params'].copy() for key in kwargs['params']: if isinstance(kwargs['params'][key], bool): kwargs['params'][key] = _json.dumps(kwargs['params'][key]) # We have a special json encoding class for non-native objects. if kwargs.get('json') is not None: if kwargs.get('data'): raise exceptions.PlotlyError('Cannot supply data and json kwargs.') kwargs['data'] = _json.dumps(kwargs.pop('json'), sort_keys=True, cls=utils.PlotlyJSONEncoder) # The config file determines whether reuqests should *verify*. kwargs['verify'] = config.get_config()['plotly_ssl_verification'] try: response = requests.request(method, url, **kwargs) except RequestException as e: # The message can be an exception. E.g., MaxRetryError. message = str(getattr(e, 'message', 'No message')) response = getattr(e, 'response', None) status_code = response.status_code if response else None content = response.content if response else 'No content' raise exceptions.PlotlyRequestError(message, status_code, content) validate_response(response) return response plotly-2.2.3+dfsg.orig/plotly/api/v2/users.py0000644000175000017500000000063013104403274020402 0ustar noahfxnoahfx"""Interface to Plotly's /v2/files endpoints.""" from __future__ import absolute_import from plotly.api.v2.utils import build_url, request RESOURCE = 'users' def current(): """ Retrieve information on the logged-in user from Plotly. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, route='current') return request('get', url) plotly-2.2.3+dfsg.orig/plotly/api/v2/images.py0000644000175000017500000000073113104403274020510 0ustar noahfxnoahfx"""Interface to Plotly's /v2/images endpoints.""" from __future__ import absolute_import from plotly.api.v2.utils import build_url, request RESOURCE = 'images' def create(body): """ Generate an image (which does not get saved on Plotly). :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE) return request('post', url, json=body) plotly-2.2.3+dfsg.orig/plotly/api/v2/folders.py0000644000175000017500000000620113104403274020677 0ustar noahfxnoahfx"""Interface to Plotly's /v2/folders endpoints.""" from __future__ import absolute_import from plotly.api.v2.utils import build_url, make_params, request RESOURCE = 'folders' def create(body): """ Create a new folder. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE) return request('post', url, json=body) def retrieve(fid, share_key=None): """ Retrieve a folder from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) share_key: The secret key granting 'read' access if private. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) params = make_params(share_key=share_key) return request('get', url, params=params) def update(fid, body): """ Update a folder from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) return request('put', url, json=body) def trash(fid): """ Soft-delete a folder from Plotly. (Can be undone with 'restore'). This action is recursively done on files inside the folder. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='trash') return request('post', url) def restore(fid): """ Restore a trashed folder from Plotly. See 'trash'. This action is recursively done on files inside the folder. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='restore') return request('post', url) def permanent_delete(fid): """ Permanently delete a trashed folder file from Plotly. See 'trash'. This action is recursively done on files inside the folder. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='permanent_delete') return request('delete', url) def lookup(path, parent=None, user=None, exists=None): """ Retrieve a folder file from Plotly without needing a fid. :param (str) path: The '/'-delimited path specifying the file location. :param (int) parent: Parent id, an integer, which the path is relative to. :param (str) user: The username to target files for. Defaults to requestor. :param (bool) exists: If True, don't return the full file, just a flag. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, route='lookup') params = make_params(path=path, parent=parent, user=user, exists=exists) return request('get', url, params=params) plotly-2.2.3+dfsg.orig/plotly/api/v2/dash_apps.py0000644000175000017500000000111413104403274021201 0ustar noahfxnoahfx""" Beta interface to Plotly's /v2/dash-apps endpoints. """ from __future__ import absolute_import from plotly.api.v2.utils import build_url, request RESOURCE = 'dash-apps' def create(body): """Create a dash app item.""" url = build_url(RESOURCE) return request('post', url, json=body) def retrieve(fid): """Retrieve a dash app from Plotly.""" url = build_url(RESOURCE, id=fid) return request('get', url) def update(fid, content): """Completely update the writable.""" url = build_url(RESOURCE, id=fid) return request('put', url, json=content) plotly-2.2.3+dfsg.orig/plotly/api/v2/grids.py0000644000175000017500000001314413104403274020355 0ustar noahfxnoahfx"""Interface to Plotly's /v2/grids endpoints.""" from __future__ import absolute_import from plotly.api.v2.utils import build_url, make_params, request RESOURCE = 'grids' def create(body): """ Create a new grid. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE) return request('post', url, json=body) def retrieve(fid, share_key=None): """ Retrieve a grid from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) share_key: The secret key granting 'read' access if private. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) params = make_params(share_key=share_key) return request('get', url, params=params) def content(fid, share_key=None): """ Retrieve full content for the grid (normal retrieve only yields preview) :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) share_key: The secret key granting 'read' access if private. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='content') params = make_params(share_key=share_key) return request('get', url, params=params) def update(fid, body): """ Update a grid from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) return request('put', url, json=body) def trash(fid): """ Soft-delete a grid from Plotly. (Can be undone with 'restore'). :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='trash') return request('post', url) def restore(fid): """ Restore a trashed grid from Plotly. See 'trash'. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='restore') return request('post', url) def permanent_delete(fid): """ Permanently delete a trashed grid file from Plotly. See 'trash'. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='permanent_delete') return request('delete', url) def lookup(path, parent=None, user=None, exists=None): """ Retrieve a grid file from Plotly without needing a fid. :param (str) path: The '/'-delimited path specifying the file location. :param (int) parent: Parent id, an integer, which the path is relative to. :param (str) user: The username to target files for. Defaults to requestor. :param (bool) exists: If True, don't return the full file, just a flag. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, route='lookup') params = make_params(path=path, parent=parent, user=user, exists=exists) return request('get', url, params=params) def col_create(fid, body): """ Create a new column (or columns) inside a grid. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='col') return request('post', url, json=body) def col_retrieve(fid, uid): """ Retrieve a column (or columns) from a grid. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) uid: A ','-concatenated string of column uids in the grid. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='col') params = make_params(uid=uid) return request('get', url, params=params) def col_update(fid, uid, body): """ Update a column (or columns) from a grid. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) uid: A ','-concatenated string of column uids in the grid. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='col') params = make_params(uid=uid) return request('put', url, json=body, params=params) def col_delete(fid, uid): """ Permanently delete a column (or columns) from a grid. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) uid: A ','-concatenated string of column uids in the grid. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='col') params = make_params(uid=uid) return request('delete', url, params=params) def row(fid, body): """ Append rows to a grid. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='row') return request('post', url, json=body) plotly-2.2.3+dfsg.orig/plotly/api/v2/files.py0000644000175000017500000000530213104403274020344 0ustar noahfxnoahfx"""Interface to Plotly's /v2/files endpoints.""" from __future__ import absolute_import from plotly.api.v2.utils import build_url, make_params, request RESOURCE = 'files' def retrieve(fid, share_key=None): """ Retrieve a general file from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (str) share_key: The secret key granting 'read' access if private. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) params = make_params(share_key=share_key) return request('get', url, params=params) def update(fid, body): """ Update a general file from Plotly. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :param (dict) body: A mapping of body param names to values. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid) return request('put', url, json=body) def trash(fid): """ Soft-delete a general file from Plotly. (Can be undone with 'restore'). :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='trash') return request('post', url) def restore(fid): """ Restore a trashed, general file from Plotly. See 'trash'. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='restore') return request('post', url) def permanent_delete(fid): """ Permanently delete a trashed, general file from Plotly. See 'trash'. :param (str) fid: The `{username}:{idlocal}` identifier. E.g. `foo:88`. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, id=fid, route='permanent_delete') return request('delete', url) def lookup(path, parent=None, user=None, exists=None): """ Retrieve a general file from Plotly without needing a fid. :param (str) path: The '/'-delimited path specifying the file location. :param (int) parent: Parent id, an integer, which the path is relative to. :param (str) user: The username to target files for. Defaults to requestor. :param (bool) exists: If True, don't return the full file, just a flag. :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE, route='lookup') params = make_params(path=path, parent=parent, user=user, exists=exists) return request('get', url, params=params) plotly-2.2.3+dfsg.orig/plotly/api/v2/plot_schema.py0000644000175000017500000000110413104403274021534 0ustar noahfxnoahfx"""Interface to Plotly's /v2/plot-schema endpoints.""" from __future__ import absolute_import from plotly.api.v2.utils import build_url, make_params, request RESOURCE = 'plot-schema' def retrieve(sha1, **kwargs): """ Retrieve the most up-to-date copy of the plot-schema wrt the given hash. :param (str) sha1: The last-known hash of the plot-schema (or ''). :returns: (requests.Response) Returns response directly from requests. """ url = build_url(RESOURCE) params = make_params(sha1=sha1) return request('get', url, params=params, **kwargs) plotly-2.2.3+dfsg.orig/plotly/api/v2/__init__.py0000644000175000017500000000034313174436015021007 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly.api.v2 import (dash_apps, dashboards, files, folders, grids, images, plot_schema, plots, spectacle_presentations, users) plotly-2.2.3+dfsg.orig/plotly/api/v2/dashboards.py0000644000175000017500000000163713136102455021365 0ustar noahfxnoahfx""" Interface to Plotly's /v2/dashboards endpoints. Partially complete at the moment. Only being used by plotly.plotly.dashboard_ops. """ from __future__ import absolute_import from plotly.api.v2.utils import build_url, request RESOURCE = 'dashboards' def create(body): """Create a dashboard.""" url = build_url(RESOURCE) return request('post', url, json=body) def list(): """Returns the list of all users' dashboards.""" url = build_url(RESOURCE) return request('get', url) def retrieve(fid): """Retrieve a dashboard from Plotly.""" url = build_url(RESOURCE, id=fid) return request('get', url) def update(fid, content): """Completely update the writable.""" url = build_url(RESOURCE, id=fid) return request('put', url, json=content) def schema(): """Retrieve the dashboard schema.""" url = build_url(RESOURCE, route='schema') return request('get', url) plotly-2.2.3+dfsg.orig/plotly/api/__init__.py0000644000175000017500000000000013104403274020440 0ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/figure_factory/0000755000175000017500000000000013211605515020601 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/figure_factory/_candlestick.py0000644000175000017500000002570213104403274023603 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly.figure_factory import utils from plotly.figure_factory._ohlc import (_DEFAULT_INCREASING_COLOR, _DEFAULT_DECREASING_COLOR, validate_ohlc) from plotly.graph_objs import graph_objs def make_increasing_candle(open, high, low, close, dates, **kwargs): """ Makes boxplot trace for increasing candlesticks _make_increasing_candle() and _make_decreasing_candle separate the increasing traces from the decreasing traces so kwargs (such as color) can be passed separately to increasing or decreasing traces when direction is set to 'increasing' or 'decreasing' in FigureFactory.create_candlestick() :param (list) open: opening values :param (list) high: high values :param (list) low: low values :param (list) close: closing values :param (list) dates: list of datetime objects. Default: None :param kwargs: kwargs to be passed to increasing trace via plotly.graph_objs.Scatter. :rtype (list) candle_incr_data: list of the box trace for increasing candlesticks. """ increase_x, increase_y = _Candlestick( open, high, low, close, dates, **kwargs).get_candle_increase() if 'line' in kwargs: kwargs.setdefault('fillcolor', kwargs['line']['color']) else: kwargs.setdefault('fillcolor', _DEFAULT_INCREASING_COLOR) if 'name' in kwargs: kwargs.setdefault('showlegend', True) else: kwargs.setdefault('showlegend', False) kwargs.setdefault('name', 'Increasing') kwargs.setdefault('line', dict(color=_DEFAULT_INCREASING_COLOR)) candle_incr_data = dict(type='box', x=increase_x, y=increase_y, whiskerwidth=0, boxpoints=False, **kwargs) return [candle_incr_data] def make_decreasing_candle(open, high, low, close, dates, **kwargs): """ Makes boxplot trace for decreasing candlesticks :param (list) open: opening values :param (list) high: high values :param (list) low: low values :param (list) close: closing values :param (list) dates: list of datetime objects. Default: None :param kwargs: kwargs to be passed to decreasing trace via plotly.graph_objs.Scatter. :rtype (list) candle_decr_data: list of the box trace for decreasing candlesticks. """ decrease_x, decrease_y = _Candlestick( open, high, low, close, dates, **kwargs).get_candle_decrease() if 'line' in kwargs: kwargs.setdefault('fillcolor', kwargs['line']['color']) else: kwargs.setdefault('fillcolor', _DEFAULT_DECREASING_COLOR) kwargs.setdefault('showlegend', False) kwargs.setdefault('line', dict(color=_DEFAULT_DECREASING_COLOR)) kwargs.setdefault('name', 'Decreasing') candle_decr_data = dict(type='box', x=decrease_x, y=decrease_y, whiskerwidth=0, boxpoints=False, **kwargs) return [candle_decr_data] def create_candlestick(open, high, low, close, dates=None, direction='both', **kwargs): """ BETA function that creates a candlestick chart :param (list) open: opening values :param (list) high: high values :param (list) low: low values :param (list) close: closing values :param (list) dates: list of datetime objects. Default: None :param (string) direction: direction can be 'increasing', 'decreasing', or 'both'. When the direction is 'increasing', the returned figure consists of all candlesticks where the close value is greater than the corresponding open value, and when the direction is 'decreasing', the returned figure consists of all candlesticks where the close value is less than or equal to the corresponding open value. When the direction is 'both', both increasing and decreasing candlesticks are returned. Default: 'both' :param kwargs: kwargs passed through plotly.graph_objs.Scatter. These kwargs describe other attributes about the ohlc Scatter trace such as the color or the legend name. For more information on valid kwargs call help(plotly.graph_objs.Scatter) :rtype (dict): returns a representation of candlestick chart figure. Example 1: Simple candlestick chart from a Pandas DataFrame ``` import plotly.plotly as py from plotly.figure_factory import create_candlestick from datetime import datetime import pandas.io.data as web df = web.DataReader("aapl", 'yahoo', datetime(2007, 10, 1), datetime(2009, 4, 1)) fig = create_candlestick(df.Open, df.High, df.Low, df.Close, dates=df.index) py.plot(fig, filename='finance/aapl-candlestick', validate=False) ``` Example 2: Add text and annotations to the candlestick chart ``` fig = create_candlestick(df.Open, df.High, df.Low, df.Close, dates=df.index) # Update the fig - all options here: https://plot.ly/python/reference/#Layout fig['layout'].update({ 'title': 'The Great Recession', 'yaxis': {'title': 'AAPL Stock'}, 'shapes': [{ 'x0': '2007-12-01', 'x1': '2007-12-01', 'y0': 0, 'y1': 1, 'xref': 'x', 'yref': 'paper', 'line': {'color': 'rgb(30,30,30)', 'width': 1} }], 'annotations': [{ 'x': '2007-12-01', 'y': 0.05, 'xref': 'x', 'yref': 'paper', 'showarrow': False, 'xanchor': 'left', 'text': 'Official start of the recession' }] }) py.plot(fig, filename='finance/aapl-recession-candlestick', validate=False) ``` Example 3: Customize the candlestick colors ``` import plotly.plotly as py from plotly.figure_factory import create_candlestick from plotly.graph_objs import Line, Marker from datetime import datetime import pandas.io.data as web df = web.DataReader("aapl", 'yahoo', datetime(2008, 1, 1), datetime(2009, 4, 1)) # Make increasing candlesticks and customize their color and name fig_increasing = create_candlestick(df.Open, df.High, df.Low, df.Close, dates=df.index, direction='increasing', name='AAPL', marker=Marker(color='rgb(150, 200, 250)'), line=Line(color='rgb(150, 200, 250)')) # Make decreasing candlesticks and customize their color and name fig_decreasing = create_candlestick(df.Open, df.High, df.Low, df.Close, dates=df.index, direction='decreasing', marker=Marker(color='rgb(128, 128, 128)'), line=Line(color='rgb(128, 128, 128)')) # Initialize the figure fig = fig_increasing # Add decreasing data with .extend() fig['data'].extend(fig_decreasing['data']) py.iplot(fig, filename='finance/aapl-candlestick-custom', validate=False) ``` Example 4: Candlestick chart with datetime objects ``` import plotly.plotly as py from plotly.figure_factory import create_candlestick from datetime import datetime # Add data open_data = [33.0, 33.3, 33.5, 33.0, 34.1] high_data = [33.1, 33.3, 33.6, 33.2, 34.8] low_data = [32.7, 32.7, 32.8, 32.6, 32.8] close_data = [33.0, 32.9, 33.3, 33.1, 33.1] dates = [datetime(year=2013, month=10, day=10), datetime(year=2013, month=11, day=10), datetime(year=2013, month=12, day=10), datetime(year=2014, month=1, day=10), datetime(year=2014, month=2, day=10)] # Create ohlc fig = create_candlestick(open_data, high_data, low_data, close_data, dates=dates) py.iplot(fig, filename='finance/simple-candlestick', validate=False) ``` """ if dates is not None: utils.validate_equal_length(open, high, low, close, dates) else: utils.validate_equal_length(open, high, low, close) validate_ohlc(open, high, low, close, direction, **kwargs) if direction is 'increasing': candle_incr_data = make_increasing_candle(open, high, low, close, dates, **kwargs) data = candle_incr_data elif direction is 'decreasing': candle_decr_data = make_decreasing_candle(open, high, low, close, dates, **kwargs) data = candle_decr_data else: candle_incr_data = make_increasing_candle(open, high, low, close, dates, **kwargs) candle_decr_data = make_decreasing_candle(open, high, low, close, dates, **kwargs) data = candle_incr_data + candle_decr_data layout = graph_objs.Layout() return graph_objs.Figure(data=data, layout=layout) class _Candlestick(object): """ Refer to FigureFactory.create_candlestick() for docstring. """ def __init__(self, open, high, low, close, dates, **kwargs): self.open = open self.high = high self.low = low self.close = close if dates is not None: self.x = dates else: self.x = [x for x in range(len(self.open))] self.get_candle_increase() def get_candle_increase(self): """ Separate increasing data from decreasing data. The data is increasing when close value > open value and decreasing when the close value <= open value. """ increase_y = [] increase_x = [] for index in range(len(self.open)): if self.close[index] > self.open[index]: increase_y.append(self.low[index]) increase_y.append(self.open[index]) increase_y.append(self.close[index]) increase_y.append(self.close[index]) increase_y.append(self.close[index]) increase_y.append(self.high[index]) increase_x.append(self.x[index]) increase_x = [[x, x, x, x, x, x] for x in increase_x] increase_x = utils.flatten(increase_x) return increase_x, increase_y def get_candle_decrease(self): """ Separate increasing data from decreasing data. The data is increasing when close value > open value and decreasing when the close value <= open value. """ decrease_y = [] decrease_x = [] for index in range(len(self.open)): if self.close[index] <= self.open[index]: decrease_y.append(self.low[index]) decrease_y.append(self.open[index]) decrease_y.append(self.close[index]) decrease_y.append(self.close[index]) decrease_y.append(self.close[index]) decrease_y.append(self.high[index]) decrease_x.append(self.x[index]) decrease_x = [[x, x, x, x, x, x] for x in decrease_x] decrease_x = utils.flatten(decrease_x) return decrease_x, decrease_y plotly-2.2.3+dfsg.orig/plotly/figure_factory/_2d_density.py0000644000175000017500000001167713104403274023371 0ustar noahfxnoahfxfrom __future__ import absolute_import from numbers import Number from plotly import exceptions from plotly.figure_factory import utils from plotly.graph_objs import graph_objs def make_linear_colorscale(colors): """ Makes a list of colors into a colorscale-acceptable form For documentation regarding to the form of the output, see https://plot.ly/python/reference/#mesh3d-colorscale """ scale = 1. / (len(colors) - 1) return [[i * scale, color] for i, color in enumerate(colors)] def create_2d_density(x, y, colorscale='Earth', ncontours=20, hist_color=(0, 0, 0.5), point_color=(0, 0, 0.5), point_size=2, title='2D Density Plot', height=600, width=600): """ Returns figure for a 2D density plot :param (list|array) x: x-axis data for plot generation :param (list|array) y: y-axis data for plot generation :param (str|tuple|list) colorscale: either a plotly scale name, an rgb or hex color, a color tuple or a list or tuple of colors. An rgb color is of the form 'rgb(x, y, z)' where x, y, z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colormap is a list, it must contain the valid color types aforementioned as its members. :param (int) ncontours: the number of 2D contours to draw on the plot :param (str) hist_color: the color of the plotted histograms :param (str) point_color: the color of the scatter points :param (str) point_size: the color of the scatter points :param (str) title: set the title for the plot :param (float) height: the height of the chart :param (float) width: the width of the chart Example 1: Simple 2D Density Plot ``` import plotly.plotly as py from plotly.figure_factory create_2d_density import numpy as np # Make data points t = np.linspace(-1,1.2,2000) x = (t**3)+(0.3*np.random.randn(2000)) y = (t**6)+(0.3*np.random.randn(2000)) # Create a figure fig = create_2D_density(x, y) # Plot the data py.iplot(fig, filename='simple-2d-density') ``` Example 2: Using Parameters ``` import plotly.plotly as py from plotly.figure_factory create_2d_density import numpy as np # Make data points t = np.linspace(-1,1.2,2000) x = (t**3)+(0.3*np.random.randn(2000)) y = (t**6)+(0.3*np.random.randn(2000)) # Create custom colorscale colorscale = ['#7A4579', '#D56073', 'rgb(236,158,105)', (1, 1, 0.2), (0.98,0.98,0.98)] # Create a figure fig = create_2D_density( x, y, colorscale=colorscale, hist_color='rgb(255, 237, 222)', point_size=3) # Plot the data py.iplot(fig, filename='use-parameters') ``` """ # validate x and y are filled with numbers only for array in [x, y]: if not all(isinstance(element, Number) for element in array): raise exceptions.PlotlyError( "All elements of your 'x' and 'y' lists must be numbers." ) # validate x and y are the same length if len(x) != len(y): raise exceptions.PlotlyError( "Both lists 'x' and 'y' must be the same length." ) colorscale = utils.validate_colors(colorscale, 'rgb') colorscale = make_linear_colorscale(colorscale) # validate hist_color and point_color hist_color = utils.validate_colors(hist_color, 'rgb') point_color = utils.validate_colors(point_color, 'rgb') trace1 = graph_objs.Scatter( x=x, y=y, mode='markers', name='points', marker=dict( color=point_color[0], size=point_size, opacity=0.4 ) ) trace2 = graph_objs.Histogram2dcontour( x=x, y=y, name='density', ncontours=ncontours, colorscale=colorscale, reversescale=True, showscale=False ) trace3 = graph_objs.Histogram( x=x, name='x density', marker=dict(color=hist_color[0]), yaxis='y2' ) trace4 = graph_objs.Histogram( y=y, name='y density', marker=dict(color=hist_color[0]), xaxis='x2' ) data = [trace1, trace2, trace3, trace4] layout = graph_objs.Layout( showlegend=False, autosize=False, title=title, height=height, width=width, xaxis=dict( domain=[0, 0.85], showgrid=False, zeroline=False ), yaxis=dict( domain=[0, 0.85], showgrid=False, zeroline=False ), margin=dict( t=50 ), hovermode='closest', bargap=0, xaxis2=dict( domain=[0.85, 1], showgrid=False, zeroline=False ), yaxis2=dict( domain=[0.85, 1], showgrid=False, zeroline=False ) ) fig = graph_objs.Figure(data=data, layout=layout) return fig plotly-2.2.3+dfsg.orig/plotly/figure_factory/utils.py0000644000175000017500000005002613207065466022330 0ustar noahfxnoahfxfrom __future__ import absolute_import import decimal from plotly import exceptions 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)'] # TODO: make PLOTLY_SCALES below like version in plotly.colors # requires rewritting scatterplot_matrix code 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': ['#440154', '#fde725'] } 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): 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], 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 " "all strings.") def validate_dataframe(array): """ Validates all strings or numbers in each dataframe column :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): 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 " "numbers or strings.") 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 " "numbers or strings.") def validate_equal_length(*args): """ Validates that data lists or ndarrays are the same length. :raises: (PlotlyError) If any data lists are not the same length. """ length = len(args[0]) if any(len(lst) != length for lst in args): raise exceptions.PlotlyError("Oops! Your data lists or ndarrays " "should be the same length.") def validate_positive_scalars(**kwargs): """ Validates that all values given in key/val pairs are positive. Accepts kwargs to improve Exception messages. :raises: (PlotlyError) If any value is < 0 or raises. """ for key, val in kwargs.items(): try: if val <= 0: raise ValueError('{} must be > 0, got {}'.format(key, val)) except TypeError: raise exceptions.PlotlyError('{} must be a number, got {}' .format(key, val)) def flatten(array): """ Uses list comprehension to flatten array :param (array): An iterable to flatten :raises (PlotlyError): If iterable is not nested. :rtype (list): The flattened list. """ try: return [item for sublist in array for item in sublist] except TypeError: raise exceptions.PlotlyError("Your data array could not be " "flattened! Make sure your data is " "entered as lists or ndarrays!") def find_intermediate_color(lowcolor, highcolor, intermed): """ Returns the color at a given distance between two colors This function takes two color tuples, where each element is between 0 and 1, along with a value 0 < intermed < 1 and returns a color that is intermed-percent from lowcolor to highcolor """ diff_0 = float(highcolor[0] - lowcolor[0]) diff_1 = float(highcolor[1] - lowcolor[1]) diff_2 = float(highcolor[2] - lowcolor[2]) return (lowcolor[0] + intermed * diff_0, lowcolor[1] + intermed * diff_1, lowcolor[2] + intermed * diff_2) def n_colors(lowcolor, highcolor, n_colors): """ Splits a low and high color into a list of n_colors colors in it Accepts two color tuples and returns a list of n_colors colors which form the intermediate colors between lowcolor and highcolor from linearly interpolating through RGB space """ diff_0 = float(highcolor[0] - lowcolor[0]) incr_0 = diff_0/(n_colors - 1) diff_1 = float(highcolor[1] - lowcolor[1]) incr_1 = diff_1/(n_colors - 1) diff_2 = float(highcolor[2] - lowcolor[2]) incr_2 = diff_2/(n_colors - 1) color_tuples = [] for index in range(n_colors): 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 def label_rgb(colors): """ Takes tuple (a, b, c) and returns an rgb color 'rgb(a, b, c)' """ return ('rgb(%s, %s, %s)' % (colors[0], colors[1], colors[2])) def unlabel_rgb(colors): """ Takes rgb color(s) 'rgb(a, b, c)' and returns tuple(s) (a, b, c) This function takes either an 'rgb(a, b, c)' color or a list of such colors and returns the color tuples in tuple(s) (a, b, c) """ str_vals = '' for index in range(len(colors)): try: float(colors[index]) str_vals = str_vals + colors[index] except ValueError: if colors[index] == ',' or colors[index] == '.': str_vals = str_vals + colors[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 = '' return (numbers[0], numbers[1], numbers[2]) def unconvert_from_RGB_255(colors): """ Return a tuple where each element gets divided by 255 Takes a (list of) color tuple(s) where each element is between 0 and 255. Returns the same tuples where each tuple element is normalized to a value between 0 and 1 """ return (colors[0]/(255.0), colors[1]/(255.0), colors[2]/(255.0)) def convert_to_RGB_255(colors): """ Multiplies each element of a triplet by 255 Each coordinate of the color tuple is rounded to the nearest float and then is turned into an integer. If a number is of the form x.5, then if x is odd, the number rounds up to (x+1). Otherwise, it rounds down to just x. This is the way rounding works in Python 3 and in current statistical analysis to avoid rounding bias """ rgb_components = [] for component in colors: rounded_num = decimal.Decimal(str(component*255.0)).quantize( decimal.Decimal('1'), rounding=decimal.ROUND_HALF_EVEN ) # convert rounded number to an integer from 'Decimal' form rounded_num = int(rounded_num) rgb_components.append(rounded_num) return (rgb_components[0], rgb_components[1], rgb_components[2]) def hex_to_rgb(value): """ Calculates rgb values from a hex color code. :param (string) value: Hex color string :rtype (tuple) (r_value, g_value, b_value): tuple of rgb values """ value = value.lstrip('#') hex_total_length = len(value) rgb_section_length = hex_total_length // 3 return tuple(int(value[i:i + rgb_section_length], 16) for i in range(0, hex_total_length, rgb_section_length)) def color_parser(colors, function): """ Takes color(s) and a function and applies the function on the color(s) In particular, this function identifies whether the given color object is an iterable or not and applies the given color-parsing function to the color or iterable of colors. If given an iterable, it will only be able to work with it if all items in the iterable are of the same type - rgb string, hex string or tuple """ from numbers import Number if isinstance(colors, str): return function(colors) if isinstance(colors, tuple) and isinstance(colors[0], Number): return function(colors) if hasattr(colors, '__iter__'): if isinstance(colors, tuple): new_color_tuple = tuple(function(item) for item in colors) return new_color_tuple else: new_color_list = [function(item) for item in colors] return new_color_list def validate_colors(colors, colortype='tuple'): """ Validates color(s) and returns a list of color(s) of a specified type """ from numbers import Number if colors is None: colors = DEFAULT_PLOTLY_COLORS if isinstance(colors, str): if colors in PLOTLY_SCALES: colors = PLOTLY_SCALES[colors] elif 'rgb' in colors or '#' in colors: colors = [colors] else: raise exceptions.PlotlyError( "If your colors variable is a string, it must be a " "Plotly scale, an rgb color or a hex color.") elif isinstance(colors, tuple): if isinstance(colors[0], Number): colors = [colors] else: colors = list(colors) # convert color elements in list to tuple color for j, each_color in enumerate(colors): if 'rgb' in each_color: each_color = color_parser(each_color, unlabel_rgb) for value in each_color: if value > 255.0: raise exceptions.PlotlyError( "Whoops! The elements in your rgb colors " "tuples cannot exceed 255.0." ) each_color = color_parser(each_color, unconvert_from_RGB_255) colors[j] = each_color if '#' in each_color: each_color = color_parser(each_color, hex_to_rgb) each_color = color_parser(each_color, unconvert_from_RGB_255) colors[j] = each_color if isinstance(each_color, tuple): for value in each_color: if value > 1.0: raise exceptions.PlotlyError( "Whoops! The elements in your colors tuples " "cannot exceed 1.0." ) colors[j] = each_color if colortype == 'rgb': for j, each_color in enumerate(colors): rgb_color = color_parser(each_color, convert_to_RGB_255) colors[j] = color_parser(rgb_color, label_rgb) return colors def validate_colors_dict(colors, colortype='tuple'): """ Validates dictioanry of color(s) """ # validate each color element in the dictionary for key in colors: if 'rgb' in colors[key]: colors[key] = color_parser(colors[key], unlabel_rgb) for value in colors[key]: if value > 255.0: raise exceptions.PlotlyError( "Whoops! The elements in your rgb colors " "tuples cannot exceed 255.0." ) colors[key] = color_parser(colors[key], unconvert_from_RGB_255) if '#' in colors[key]: colors[key] = color_parser(colors[key], hex_to_rgb) colors[key] = color_parser(colors[key], unconvert_from_RGB_255) if isinstance(colors[key], tuple): for value in colors[key]: if value > 1.0: raise exceptions.PlotlyError( "Whoops! The elements in your colors tuples " "cannot exceed 1.0." ) if colortype == 'rgb': for key in colors: colors[key] = color_parser(colors[key], convert_to_RGB_255) colors[key] = color_parser(colors[key], label_rgb) return colors def colorscale_to_colors(colorscale): """ Extracts the colors from colorscale as a list """ color_list = [] for item in colorscale: color_list.append(item[1]) return color_list def colorscale_to_scale(colorscale): """ Extracts the interpolation scale values from colorscale as a list """ scale_list = [] for item in colorscale: scale_list.append(item[0]) return scale_list def validate_scale_values(scale): """ Validates scale values from a colorscale :param (list) scale: a strictly increasing list of floats that begins with 0 and ends with 1. Its usage derives from a colorscale which is a list of two-lists (a list with two elements) of the form [value, color] which are used to determine how interpolation weighting works between the colors in the colorscale. Therefore scale is just the extraction of these values from the two-lists in order """ if len(scale) < 2: raise exceptions.PlotlyError('You must input a list of scale values ' 'that has at least two values.') if (scale[0] != 0) or (scale[-1] != 1): raise exceptions.PlotlyError( 'The first and last number in your scale must be 0.0 and 1.0 ' 'respectively.' ) if not all(x < y for x, y in zip(scale, scale[1:])): raise exceptions.PlotlyError( "'scale' must be a list that contains a strictly increasing " "sequence of numbers." ) def validate_colorscale(colorscale): """Validate the structure, scale values and colors of colorscale.""" if not isinstance(colorscale, list): #TODO Write tests for these exceptions raise exceptions.PlotlyError("A valid colorscale must be a list.") if not all(isinstance(innerlist, list) for innerlist in colorscale): raise exceptions.PlotlyError( "A valid colorscale must be a list of lists." ) colorscale_colors = colorscale_to_colors(colorscale) scale_values = colorscale_to_scale(colorscale) validate_scale_values(scale_values) validate_colors(colorscale_colors) 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, 6] returns [[-inf, 1], [1, 6], [6, inf]] :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))): 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, str): 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 def annotation_dict_for_label(text, lane, num_of_lanes, subplot_spacing, row_col='col', flipped=True, right_side=True, text_color='#0f0f0f'): """ Returns annotation dict for label of n labels of a 1xn or nx1 subplot. :param (str) text: the text for a label. :param (int) lane: the label number for text. From 1 to n inclusive. :param (int) num_of_lanes: the number 'n' of rows or columns in subplot. :param (float) subplot_spacing: the value for the horizontal_spacing and vertical_spacing params in your plotly.tools.make_subplots() call. :param (str) row_col: choose whether labels are placed along rows or columns. :param (bool) flipped: flips text by 90 degrees. Text is printed horizontally if set to True and row_col='row', or if False and row_col='col'. :param (bool) right_side: only applicable if row_col is set to 'row'. :param (str) text_color: color of the text. """ l = (1 - (num_of_lanes - 1) * subplot_spacing) / (num_of_lanes) if not flipped: xanchor = 'center' yanchor = 'middle' if row_col == 'col': x = (lane - 1) * (l + subplot_spacing) + 0.5 * l y = 1.03 textangle = 0 elif row_col == 'row': y = (lane - 1) * (l + subplot_spacing) + 0.5 * l x = 1.03 textangle = 90 else: if row_col == 'col': xanchor = 'center' yanchor = 'bottom' x = (lane - 1) * (l + subplot_spacing) + 0.5 * l y = 1.0 textangle = 270 elif row_col == 'row': yanchor = 'middle' y = (lane - 1) * (l + subplot_spacing) + 0.5 * l if right_side: x = 1.0 xanchor = 'left' else: x = -0.01 xanchor = 'right' textangle = 0 annotation_dict = dict( textangle=textangle, xanchor=xanchor, yanchor=yanchor, x=x, y=y, showarrow=False, xref='paper', yref='paper', text=text, font=dict( size=13, color=text_color ) ) return annotation_dict def list_of_options(iterable, conj='and', period=True): """ Returns an English listing of objects seperated by commas ',' For example, ['foo', 'bar', 'baz'] becomes 'foo, bar and baz' if the conjunction 'and' is selected. """ if len(iterable) < 2: raise exceptions.PlotlyError( 'Your list or tuple must contain at least 2 items.' ) template = (len(iterable) - 2)*'{}, ' + '{} ' + conj + ' {}' + period*'.' return template.format(*iterable) plotly-2.2.3+dfsg.orig/plotly/figure_factory/_streamline.py0000644000175000017500000003504213104403274023460 0ustar noahfxnoahfxfrom __future__ import absolute_import import math from plotly import exceptions, optional_imports from plotly.figure_factory import utils from plotly.graph_objs import graph_objs np = optional_imports.get_module('numpy') def validate_streamline(x, y): """ Streamline-specific validations Specifically, this checks that x and y are both evenly spaced, and that the package numpy is available. See FigureFactory.create_streamline() for params :raises: (ImportError) If numpy is not available. :raises: (PlotlyError) If x is not evenly spaced. :raises: (PlotlyError) If y is not evenly spaced. """ if np is False: raise ImportError("FigureFactory.create_streamline requires numpy") for index in range(len(x) - 1): if ((x[index + 1] - x[index]) - (x[1] - x[0])) > .0001: raise exceptions.PlotlyError("x must be a 1 dimensional, " "evenly spaced array") for index in range(len(y) - 1): if ((y[index + 1] - y[index]) - (y[1] - y[0])) > .0001: raise exceptions.PlotlyError("y must be a 1 dimensional, " "evenly spaced array") def create_streamline(x, y, u, v, density=1, angle=math.pi / 9, arrow_scale=.09, **kwargs): """ Returns data for a streamline plot. :param (list|ndarray) x: 1 dimensional, evenly spaced list or array :param (list|ndarray) y: 1 dimensional, evenly spaced list or array :param (ndarray) u: 2 dimensional array :param (ndarray) v: 2 dimensional array :param (float|int) density: controls the density of streamlines in plot. This is multiplied by 30 to scale similiarly to other available streamline functions such as matplotlib. Default = 1 :param (angle in radians) angle: angle of arrowhead. Default = pi/9 :param (float in [0,1]) arrow_scale: value to scale length of arrowhead Default = .09 :param kwargs: kwargs passed through plotly.graph_objs.Scatter for more information on valid kwargs call help(plotly.graph_objs.Scatter) :rtype (dict): returns a representation of streamline figure. Example 1: Plot simple streamline and increase arrow size ``` import plotly.plotly as py from plotly.figure_factory import create_streamline import numpy as np import math # Add data x = np.linspace(-3, 3, 100) y = np.linspace(-3, 3, 100) Y, X = np.meshgrid(x, y) u = -1 - X**2 + Y v = 1 + X - Y**2 u = u.T # Transpose v = v.T # Transpose # Create streamline fig = create_streamline(x, y, u, v, arrow_scale=.1) # Plot py.plot(fig, filename='streamline') ``` Example 2: from nbviewer.ipython.org/github/barbagroup/AeroPython ``` import plotly.plotly as py from plotly.figure_factory import create_streamline import numpy as np import math # Add data N = 50 x_start, x_end = -2.0, 2.0 y_start, y_end = -1.0, 1.0 x = np.linspace(x_start, x_end, N) y = np.linspace(y_start, y_end, N) X, Y = np.meshgrid(x, y) ss = 5.0 x_s, y_s = -1.0, 0.0 # Compute the velocity field on the mesh grid u_s = ss/(2*np.pi) * (X-x_s)/((X-x_s)**2 + (Y-y_s)**2) v_s = ss/(2*np.pi) * (Y-y_s)/((X-x_s)**2 + (Y-y_s)**2) # Create streamline fig = create_streamline(x, y, u_s, v_s, density=2, name='streamline') # Add source point point = Scatter(x=[x_s], y=[y_s], mode='markers', marker=Marker(size=14), name='source point') # Plot fig['data'].append(point) py.plot(fig, filename='streamline') ``` """ utils.validate_equal_length(x, y) utils.validate_equal_length(u, v) validate_streamline(x, y) utils.validate_positive_scalars(density=density, arrow_scale=arrow_scale) streamline_x, streamline_y = _Streamline(x, y, u, v, density, angle, arrow_scale).sum_streamlines() arrow_x, arrow_y = _Streamline(x, y, u, v, density, angle, arrow_scale).get_streamline_arrows() streamline = graph_objs.Scatter(x=streamline_x + arrow_x, y=streamline_y + arrow_y, mode='lines', **kwargs) data = [streamline] layout = graph_objs.Layout(hovermode='closest') return graph_objs.Figure(data=data, layout=layout) class _Streamline(object): """ Refer to FigureFactory.create_streamline() for docstring """ def __init__(self, x, y, u, v, density, angle, arrow_scale, **kwargs): self.x = np.array(x) self.y = np.array(y) self.u = np.array(u) self.v = np.array(v) self.angle = angle self.arrow_scale = arrow_scale self.density = int(30 * density) # Scale similarly to other functions self.delta_x = self.x[1] - self.x[0] self.delta_y = self.y[1] - self.y[0] self.val_x = self.x self.val_y = self.y # Set up spacing self.blank = np.zeros((self.density, self.density)) self.spacing_x = len(self.x) / float(self.density - 1) self.spacing_y = len(self.y) / float(self.density - 1) self.trajectories = [] # Rescale speed onto axes-coordinates self.u = self.u / (self.x[-1] - self.x[0]) self.v = self.v / (self.y[-1] - self.y[0]) self.speed = np.sqrt(self.u ** 2 + self.v ** 2) # Rescale u and v for integrations. self.u *= len(self.x) self.v *= len(self.y) self.st_x = [] self.st_y = [] self.get_streamlines() streamline_x, streamline_y = self.sum_streamlines() arrows_x, arrows_y = self.get_streamline_arrows() def blank_pos(self, xi, yi): """ Set up positions for trajectories to be used with rk4 function. """ return (int((xi / self.spacing_x) + 0.5), int((yi / self.spacing_y) + 0.5)) def value_at(self, a, xi, yi): """ Set up for RK4 function, based on Bokeh's streamline code """ if isinstance(xi, np.ndarray): self.x = xi.astype(np.int) self.y = yi.astype(np.int) else: self.val_x = np.int(xi) self.val_y = np.int(yi) a00 = a[self.val_y, self.val_x] a01 = a[self.val_y, self.val_x + 1] a10 = a[self.val_y + 1, self.val_x] a11 = a[self.val_y + 1, self.val_x + 1] xt = xi - self.val_x yt = yi - self.val_y a0 = a00 * (1 - xt) + a01 * xt a1 = a10 * (1 - xt) + a11 * xt return a0 * (1 - yt) + a1 * yt def rk4_integrate(self, x0, y0): """ RK4 forward and back trajectories from the initial conditions. Adapted from Bokeh's streamline -uses Runge-Kutta method to fill x and y trajectories then checks length of traj (s in units of axes) """ def f(xi, yi): dt_ds = 1. / self.value_at(self.speed, xi, yi) ui = self.value_at(self.u, xi, yi) vi = self.value_at(self.v, xi, yi) return ui * dt_ds, vi * dt_ds def g(xi, yi): dt_ds = 1. / self.value_at(self.speed, xi, yi) ui = self.value_at(self.u, xi, yi) vi = self.value_at(self.v, xi, yi) return -ui * dt_ds, -vi * dt_ds check = lambda xi, yi: (0 <= xi < len(self.x) - 1 and 0 <= yi < len(self.y) - 1) xb_changes = [] yb_changes = [] def rk4(x0, y0, f): ds = 0.01 stotal = 0 xi = x0 yi = y0 xb, yb = self.blank_pos(xi, yi) xf_traj = [] yf_traj = [] while check(xi, yi): xf_traj.append(xi) yf_traj.append(yi) try: k1x, k1y = f(xi, yi) k2x, k2y = f(xi + .5 * ds * k1x, yi + .5 * ds * k1y) k3x, k3y = f(xi + .5 * ds * k2x, yi + .5 * ds * k2y) k4x, k4y = f(xi + ds * k3x, yi + ds * k3y) except IndexError: break xi += ds * (k1x + 2 * k2x + 2 * k3x + k4x) / 6. yi += ds * (k1y + 2 * k2y + 2 * k3y + k4y) / 6. if not check(xi, yi): break stotal += ds new_xb, new_yb = self.blank_pos(xi, yi) if new_xb != xb or new_yb != yb: if self.blank[new_yb, new_xb] == 0: self.blank[new_yb, new_xb] = 1 xb_changes.append(new_xb) yb_changes.append(new_yb) xb = new_xb yb = new_yb else: break if stotal > 2: break return stotal, xf_traj, yf_traj sf, xf_traj, yf_traj = rk4(x0, y0, f) sb, xb_traj, yb_traj = rk4(x0, y0, g) stotal = sf + sb x_traj = xb_traj[::-1] + xf_traj[1:] y_traj = yb_traj[::-1] + yf_traj[1:] if len(x_traj) < 1: return None if stotal > .2: initxb, inityb = self.blank_pos(x0, y0) self.blank[inityb, initxb] = 1 return x_traj, y_traj else: for xb, yb in zip(xb_changes, yb_changes): self.blank[yb, xb] = 0 return None def traj(self, xb, yb): """ Integrate trajectories :param (int) xb: results of passing xi through self.blank_pos :param (int) xy: results of passing yi through self.blank_pos Calculate each trajectory based on rk4 integrate method. """ if xb < 0 or xb >= self.density or yb < 0 or yb >= self.density: return if self.blank[yb, xb] == 0: t = self.rk4_integrate(xb * self.spacing_x, yb * self.spacing_y) if t is not None: self.trajectories.append(t) def get_streamlines(self): """ Get streamlines by building trajectory set. """ for indent in range(self.density // 2): for xi in range(self.density - 2 * indent): self.traj(xi + indent, indent) self.traj(xi + indent, self.density - 1 - indent) self.traj(indent, xi + indent) self.traj(self.density - 1 - indent, xi + indent) self.st_x = [np.array(t[0]) * self.delta_x + self.x[0] for t in self.trajectories] self.st_y = [np.array(t[1]) * self.delta_y + self.y[0] for t in self.trajectories] for index in range(len(self.st_x)): self.st_x[index] = self.st_x[index].tolist() self.st_x[index].append(np.nan) for index in range(len(self.st_y)): self.st_y[index] = self.st_y[index].tolist() self.st_y[index].append(np.nan) def get_streamline_arrows(self): """ Makes an arrow for each streamline. Gets angle of streamline at 1/3 mark and creates arrow coordinates based off of user defined angle and arrow_scale. :param (array) st_x: x-values for all streamlines :param (array) st_y: y-values for all streamlines :param (angle in radians) angle: angle of arrowhead. Default = pi/9 :param (float in [0,1]) arrow_scale: value to scale length of arrowhead Default = .09 :rtype (list, list) arrows_x: x-values to create arrowhead and arrows_y: y-values to create arrowhead """ arrow_end_x = np.empty((len(self.st_x))) arrow_end_y = np.empty((len(self.st_y))) arrow_start_x = np.empty((len(self.st_x))) arrow_start_y = np.empty((len(self.st_y))) for index in range(len(self.st_x)): arrow_end_x[index] = (self.st_x[index] [int(len(self.st_x[index]) / 3)]) arrow_start_x[index] = (self.st_x[index] [(int(len(self.st_x[index]) / 3)) - 1]) arrow_end_y[index] = (self.st_y[index] [int(len(self.st_y[index]) / 3)]) arrow_start_y[index] = (self.st_y[index] [(int(len(self.st_y[index]) / 3)) - 1]) dif_x = arrow_end_x - arrow_start_x dif_y = arrow_end_y - arrow_start_y streamline_ang = np.arctan(dif_y / dif_x) ang1 = streamline_ang + (self.angle) ang2 = streamline_ang - (self.angle) seg1_x = np.cos(ang1) * self.arrow_scale seg1_y = np.sin(ang1) * self.arrow_scale seg2_x = np.cos(ang2) * self.arrow_scale seg2_y = np.sin(ang2) * self.arrow_scale point1_x = np.empty((len(dif_x))) point1_y = np.empty((len(dif_y))) point2_x = np.empty((len(dif_x))) point2_y = np.empty((len(dif_y))) for index in range(len(dif_x)): if dif_x[index] >= 0: point1_x[index] = arrow_end_x[index] - seg1_x[index] point1_y[index] = arrow_end_y[index] - seg1_y[index] point2_x[index] = arrow_end_x[index] - seg2_x[index] point2_y[index] = arrow_end_y[index] - seg2_y[index] else: point1_x[index] = arrow_end_x[index] + seg1_x[index] point1_y[index] = arrow_end_y[index] + seg1_y[index] point2_x[index] = arrow_end_x[index] + seg2_x[index] point2_y[index] = arrow_end_y[index] + seg2_y[index] space = np.empty((len(point1_x))) space[:] = np.nan # Combine arrays into matrix arrows_x = np.matrix([point1_x, arrow_end_x, point2_x, space]) arrows_x = np.array(arrows_x) arrows_x = arrows_x.flatten('F') arrows_x = arrows_x.tolist() # Combine arrays into matrix arrows_y = np.matrix([point1_y, arrow_end_y, point2_y, space]) arrows_y = np.array(arrows_y) arrows_y = arrows_y.flatten('F') arrows_y = arrows_y.tolist() return arrows_x, arrows_y def sum_streamlines(self): """ Makes all streamlines readable as a single trace. :rtype (list, list): streamline_x: all x values for each streamline combined into single list and streamline_y: all y values for each streamline combined into single list """ streamline_x = sum(self.st_x, []) streamline_y = sum(self.st_y, []) return streamline_x, streamline_y plotly-2.2.3+dfsg.orig/plotly/figure_factory/_distplot.py0000644000175000017500000003425513167216100023163 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly import exceptions, optional_imports from plotly.figure_factory import utils from plotly.graph_objs import graph_objs # Optional imports, may be None for users that only use our core functionality. np = optional_imports.get_module('numpy') pd = optional_imports.get_module('pandas') scipy = optional_imports.get_module('scipy') scipy_stats = optional_imports.get_module('scipy.stats') DEFAULT_HISTNORM = 'probability density' ALTERNATIVE_HISTNORM = 'probability' def validate_distplot(hist_data, curve_type): """ Distplot-specific validations :raises: (PlotlyError) If hist_data is not a list of lists :raises: (PlotlyError) If curve_type is not valid (i.e. not 'kde' or 'normal'). """ hist_data_types = (list,) if np: hist_data_types += (np.ndarray,) if pd: hist_data_types += (pd.core.series.Series,) if not isinstance(hist_data[0], hist_data_types): raise exceptions.PlotlyError("Oops, this function was written " "to handle multiple datasets, if " "you want to plot just one, make " "sure your hist_data variable is " "still a list of lists, i.e. x = " "[1, 2, 3] -> x = [[1, 2, 3]]") curve_opts = ('kde', 'normal') if curve_type not in curve_opts: raise exceptions.PlotlyError("curve_type must be defined as " "'kde' or 'normal'") if not scipy: raise ImportError("FigureFactory.create_distplot requires scipy") def create_distplot(hist_data, group_labels, bin_size=1., curve_type='kde', colors=None, rug_text=None, histnorm=DEFAULT_HISTNORM, show_hist=True, show_curve=True, show_rug=True): """ BETA function that creates a distplot similar to seaborn.distplot The distplot can be composed of all or any combination of the following 3 components: (1) histogram, (2) curve: (a) kernel density estimation or (b) normal curve, and (3) rug plot. Additionally, multiple distplots (from multiple datasets) can be created in the same plot. :param (list[list]) hist_data: Use list of lists to plot multiple data sets on the same plot. :param (list[str]) group_labels: Names for each data set. :param (list[float]|float) bin_size: Size of histogram bins. Default = 1. :param (str) curve_type: 'kde' or 'normal'. Default = 'kde' :param (str) histnorm: 'probability density' or 'probability' Default = 'probability density' :param (bool) show_hist: Add histogram to distplot? Default = True :param (bool) show_curve: Add curve to distplot? Default = True :param (bool) show_rug: Add rug to distplot? Default = True :param (list[str]) colors: Colors for traces. :param (list[list]) rug_text: Hovertext values for rug_plot, :return (dict): Representation of a distplot figure. Example 1: Simple distplot of 1 data set ``` import plotly.plotly as py from plotly.figure_factory import create_distplot hist_data = [[1.1, 1.1, 2.5, 3.0, 3.5, 3.5, 4.1, 4.4, 4.5, 4.5, 5.0, 5.0, 5.2, 5.5, 5.5, 5.5, 5.5, 5.5, 6.1, 7.0]] group_labels = ['distplot example'] fig = create_distplot(hist_data, group_labels) url = py.plot(fig, filename='Simple distplot', validate=False) ``` Example 2: Two data sets and added rug text ``` import plotly.plotly as py from plotly.figure_factory import create_distplot # Add histogram data hist1_x = [0.8, 1.2, 0.2, 0.6, 1.6, -0.9, -0.07, 1.95, 0.9, -0.2, -0.5, 0.3, 0.4, -0.37, 0.6] hist2_x = [0.8, 1.5, 1.5, 0.6, 0.59, 1.0, 0.8, 1.7, 0.5, 0.8, -0.3, 1.2, 0.56, 0.3, 2.2] # Group data together hist_data = [hist1_x, hist2_x] group_labels = ['2012', '2013'] # Add text rug_text_1 = ['a1', 'b1', 'c1', 'd1', 'e1', 'f1', 'g1', 'h1', 'i1', 'j1', 'k1', 'l1', 'm1', 'n1', 'o1'] rug_text_2 = ['a2', 'b2', 'c2', 'd2', 'e2', 'f2', 'g2', 'h2', 'i2', 'j2', 'k2', 'l2', 'm2', 'n2', 'o2'] # Group text together rug_text_all = [rug_text_1, rug_text_2] # Create distplot fig = create_distplot( hist_data, group_labels, rug_text=rug_text_all, bin_size=.2) # Add title fig['layout'].update(title='Dist Plot') # Plot! url = py.plot(fig, filename='Distplot with rug text', validate=False) ``` Example 3: Plot with normal curve and hide rug plot ``` import plotly.plotly as py from plotly.figure_factory import create_distplot import numpy as np x1 = np.random.randn(190) x2 = np.random.randn(200)+1 x3 = np.random.randn(200)-1 x4 = np.random.randn(210)+2 hist_data = [x1, x2, x3, x4] group_labels = ['2012', '2013', '2014', '2015'] fig = create_distplot( hist_data, group_labels, curve_type='normal', show_rug=False, bin_size=.4) url = py.plot(fig, filename='hist and normal curve', validate=False) Example 4: Distplot with Pandas ``` import plotly.plotly as py from plotly.figure_factory import create_distplot import numpy as np import pandas as pd df = pd.DataFrame({'2012': np.random.randn(200), '2013': np.random.randn(200)+1}) py.iplot(create_distplot([df[c] for c in df.columns], df.columns), filename='examples/distplot with pandas', validate=False) ``` """ if colors is None: colors = [] if rug_text is None: rug_text = [] validate_distplot(hist_data, curve_type) utils.validate_equal_length(hist_data, group_labels) if isinstance(bin_size, (float, int)): bin_size = [bin_size] * len(hist_data) hist = _Distplot( hist_data, histnorm, group_labels, bin_size, curve_type, colors, rug_text, show_hist, show_curve).make_hist() if curve_type == 'normal': curve = _Distplot( hist_data, histnorm, group_labels, bin_size, curve_type, colors, rug_text, show_hist, show_curve).make_normal() else: curve = _Distplot( hist_data, histnorm, group_labels, bin_size, curve_type, colors, rug_text, show_hist, show_curve).make_kde() rug = _Distplot( hist_data, histnorm, group_labels, bin_size, curve_type, colors, rug_text, show_hist, show_curve).make_rug() data = [] if show_hist: data.append(hist) if show_curve: data.append(curve) if show_rug: data.append(rug) layout = graph_objs.Layout( barmode='overlay', hovermode='closest', legend=dict(traceorder='reversed'), xaxis1=dict(domain=[0.0, 1.0], anchor='y2', zeroline=False), yaxis1=dict(domain=[0.35, 1], anchor='free', position=0.0), yaxis2=dict(domain=[0, 0.25], anchor='x1', dtick=1, showticklabels=False)) else: layout = graph_objs.Layout( barmode='overlay', hovermode='closest', legend=dict(traceorder='reversed'), xaxis1=dict(domain=[0.0, 1.0], anchor='y2', zeroline=False), yaxis1=dict(domain=[0., 1], anchor='free', position=0.0)) data = sum(data, []) return graph_objs.Figure(data=data, layout=layout) class _Distplot(object): """ Refer to TraceFactory.create_distplot() for docstring """ def __init__(self, hist_data, histnorm, group_labels, bin_size, curve_type, colors, rug_text, show_hist, show_curve): self.hist_data = hist_data self.histnorm = histnorm self.group_labels = group_labels self.bin_size = bin_size self.show_hist = show_hist self.show_curve = show_curve self.trace_number = len(hist_data) if rug_text: self.rug_text = rug_text else: self.rug_text = [None] * self.trace_number self.start = [] self.end = [] if colors: self.colors = colors else: self.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)"] self.curve_x = [None] * self.trace_number self.curve_y = [None] * self.trace_number for trace in self.hist_data: self.start.append(min(trace) * 1.) self.end.append(max(trace) * 1.) def make_hist(self): """ Makes the histogram(s) for FigureFactory.create_distplot(). :rtype (list) hist: list of histogram representations """ hist = [None] * self.trace_number for index in range(self.trace_number): hist[index] = dict(type='histogram', x=self.hist_data[index], xaxis='x1', yaxis='y1', histnorm=self.histnorm, name=self.group_labels[index], legendgroup=self.group_labels[index], marker=dict(color=self.colors[index % len(self.colors)]), autobinx=False, xbins=dict(start=self.start[index], end=self.end[index], size=self.bin_size[index]), opacity=.7) return hist def make_kde(self): """ Makes the kernel density estimation(s) for create_distplot(). This is called when curve_type = 'kde' in create_distplot(). :rtype (list) curve: list of kde representations """ curve = [None] * self.trace_number for index in range(self.trace_number): self.curve_x[index] = [self.start[index] + x * (self.end[index] - self.start[index]) / 500 for x in range(500)] self.curve_y[index] = (scipy_stats.gaussian_kde (self.hist_data[index]) (self.curve_x[index])) if self.histnorm == ALTERNATIVE_HISTNORM: self.curve_y[index] *= self.bin_size[index] for index in range(self.trace_number): curve[index] = dict(type='scatter', x=self.curve_x[index], y=self.curve_y[index], xaxis='x1', yaxis='y1', mode='lines', name=self.group_labels[index], legendgroup=self.group_labels[index], showlegend=False if self.show_hist else True, marker=dict(color=self.colors[index % len(self.colors)])) return curve def make_normal(self): """ Makes the normal curve(s) for create_distplot(). This is called when curve_type = 'normal' in create_distplot(). :rtype (list) curve: list of normal curve representations """ curve = [None] * self.trace_number mean = [None] * self.trace_number sd = [None] * self.trace_number for index in range(self.trace_number): mean[index], sd[index] = (scipy_stats.norm.fit (self.hist_data[index])) self.curve_x[index] = [self.start[index] + x * (self.end[index] - self.start[index]) / 500 for x in range(500)] self.curve_y[index] = scipy_stats.norm.pdf( self.curve_x[index], loc=mean[index], scale=sd[index]) if self.histnorm == ALTERNATIVE_HISTNORM: self.curve_y[index] *= self.bin_size[index] for index in range(self.trace_number): curve[index] = dict(type='scatter', x=self.curve_x[index], y=self.curve_y[index], xaxis='x1', yaxis='y1', mode='lines', name=self.group_labels[index], legendgroup=self.group_labels[index], showlegend=False if self.show_hist else True, marker=dict(color=self.colors[index % len(self.colors)])) return curve def make_rug(self): """ Makes the rug plot(s) for create_distplot(). :rtype (list) rug: list of rug plot representations """ rug = [None] * self.trace_number for index in range(self.trace_number): rug[index] = dict(type='scatter', x=self.hist_data[index], y=([self.group_labels[index]] * len(self.hist_data[index])), xaxis='x1', yaxis='y2', mode='markers', name=self.group_labels[index], legendgroup=self.group_labels[index], showlegend=(False if self.show_hist or self.show_curve else True), text=self.rug_text[index], marker=dict(color=self.colors[index % len(self.colors)], symbol='line-ns-open')) return rug plotly-2.2.3+dfsg.orig/plotly/figure_factory/_ohlc.py0000644000175000017500000003406013104403274022241 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly import exceptions from plotly.graph_objs import graph_objs from plotly.figure_factory import utils # Default colours for finance charts _DEFAULT_INCREASING_COLOR = '#3D9970' # http://clrs.cc _DEFAULT_DECREASING_COLOR = '#FF4136' def validate_ohlc(open, high, low, close, direction, **kwargs): """ ohlc and candlestick specific validations Specifically, this checks that the high value is the greatest value and the low value is the lowest value in each unit. See FigureFactory.create_ohlc() or FigureFactory.create_candlestick() for params :raises: (PlotlyError) If the high value is not the greatest value in each unit. :raises: (PlotlyError) If the low value is not the lowest value in each unit. :raises: (PlotlyError) If direction is not 'increasing' or 'decreasing' """ for lst in [open, low, close]: for index in range(len(high)): if high[index] < lst[index]: raise exceptions.PlotlyError("Oops! Looks like some of " "your high values are less " "the corresponding open, " "low, or close values. " "Double check that your data " "is entered in O-H-L-C order") for lst in [open, high, close]: for index in range(len(low)): if low[index] > lst[index]: raise exceptions.PlotlyError("Oops! Looks like some of " "your low values are greater " "than the corresponding high" ", open, or close values. " "Double check that your data " "is entered in O-H-L-C order") direction_opts = ('increasing', 'decreasing', 'both') if direction not in direction_opts: raise exceptions.PlotlyError("direction must be defined as " "'increasing', 'decreasing', or " "'both'") def make_increasing_ohlc(open, high, low, close, dates, **kwargs): """ Makes increasing ohlc sticks _make_increasing_ohlc() and _make_decreasing_ohlc separate the increasing trace from the decreasing trace so kwargs (such as color) can be passed separately to increasing or decreasing traces when direction is set to 'increasing' or 'decreasing' in FigureFactory.create_candlestick() :param (list) open: opening values :param (list) high: high values :param (list) low: low values :param (list) close: closing values :param (list) dates: list of datetime objects. Default: None :param kwargs: kwargs to be passed to increasing trace via plotly.graph_objs.Scatter. :rtype (trace) ohlc_incr_data: Scatter trace of all increasing ohlc sticks. """ (flat_increase_x, flat_increase_y, text_increase) = _OHLC(open, high, low, close, dates).get_increase() if 'name' in kwargs: showlegend = True else: kwargs.setdefault('name', 'Increasing') showlegend = False kwargs.setdefault('line', dict(color=_DEFAULT_INCREASING_COLOR, width=1)) kwargs.setdefault('text', text_increase) ohlc_incr = dict(type='scatter', x=flat_increase_x, y=flat_increase_y, mode='lines', showlegend=showlegend, **kwargs) return ohlc_incr def make_decreasing_ohlc(open, high, low, close, dates, **kwargs): """ Makes decreasing ohlc sticks :param (list) open: opening values :param (list) high: high values :param (list) low: low values :param (list) close: closing values :param (list) dates: list of datetime objects. Default: None :param kwargs: kwargs to be passed to increasing trace via plotly.graph_objs.Scatter. :rtype (trace) ohlc_decr_data: Scatter trace of all decreasing ohlc sticks. """ (flat_decrease_x, flat_decrease_y, text_decrease) = _OHLC(open, high, low, close, dates).get_decrease() kwargs.setdefault('line', dict(color=_DEFAULT_DECREASING_COLOR, width=1)) kwargs.setdefault('text', text_decrease) kwargs.setdefault('showlegend', False) kwargs.setdefault('name', 'Decreasing') ohlc_decr = dict(type='scatter', x=flat_decrease_x, y=flat_decrease_y, mode='lines', **kwargs) return ohlc_decr def create_ohlc(open, high, low, close, dates=None, direction='both', **kwargs): """ BETA function that creates an ohlc chart :param (list) open: opening values :param (list) high: high values :param (list) low: low values :param (list) close: closing :param (list) dates: list of datetime objects. Default: None :param (string) direction: direction can be 'increasing', 'decreasing', or 'both'. When the direction is 'increasing', the returned figure consists of all units where the close value is greater than the corresponding open value, and when the direction is 'decreasing', the returned figure consists of all units where the close value is less than or equal to the corresponding open value. When the direction is 'both', both increasing and decreasing units are returned. Default: 'both' :param kwargs: kwargs passed through plotly.graph_objs.Scatter. These kwargs describe other attributes about the ohlc Scatter trace such as the color or the legend name. For more information on valid kwargs call help(plotly.graph_objs.Scatter) :rtype (dict): returns a representation of an ohlc chart figure. Example 1: Simple OHLC chart from a Pandas DataFrame ``` import plotly.plotly as py from plotly.figure_factory import create_ohlc from datetime import datetime import pandas.io.data as web df = web.DataReader("aapl", 'yahoo', datetime(2008, 8, 15), datetime(2008, 10, 15)) fig = create_ohlc(df.Open, df.High, df.Low, df.Close, dates=df.index) py.plot(fig, filename='finance/aapl-ohlc') ``` Example 2: Add text and annotations to the OHLC chart ``` import plotly.plotly as py from plotly.figure_factory import create_ohlc from datetime import datetime import pandas.io.data as web df = web.DataReader("aapl", 'yahoo', datetime(2008, 8, 15), datetime(2008, 10, 15)) fig = create_ohlc(df.Open, df.High, df.Low, df.Close, dates=df.index) # Update the fig - options here: https://plot.ly/python/reference/#Layout fig['layout'].update({ 'title': 'The Great Recession', 'yaxis': {'title': 'AAPL Stock'}, 'shapes': [{ 'x0': '2008-09-15', 'x1': '2008-09-15', 'type': 'line', 'y0': 0, 'y1': 1, 'xref': 'x', 'yref': 'paper', 'line': {'color': 'rgb(40,40,40)', 'width': 0.5} }], 'annotations': [{ 'text': "the fall of Lehman Brothers", 'x': '2008-09-15', 'y': 1.02, 'xref': 'x', 'yref': 'paper', 'showarrow': False, 'xanchor': 'left' }] }) py.plot(fig, filename='finance/aapl-recession-ohlc', validate=False) ``` Example 3: Customize the OHLC colors ``` import plotly.plotly as py from plotly.figure_factory import create_ohlc from plotly.graph_objs import Line, Marker from datetime import datetime import pandas.io.data as web df = web.DataReader("aapl", 'yahoo', datetime(2008, 1, 1), datetime(2009, 4, 1)) # Make increasing ohlc sticks and customize their color and name fig_increasing = create_ohlc(df.Open, df.High, df.Low, df.Close, dates=df.index, direction='increasing', name='AAPL', line=Line(color='rgb(150, 200, 250)')) # Make decreasing ohlc sticks and customize their color and name fig_decreasing = create_ohlc(df.Open, df.High, df.Low, df.Close, dates=df.index, direction='decreasing', line=Line(color='rgb(128, 128, 128)')) # Initialize the figure fig = fig_increasing # Add decreasing data with .extend() fig['data'].extend(fig_decreasing['data']) py.iplot(fig, filename='finance/aapl-ohlc-colors', validate=False) ``` Example 4: OHLC chart with datetime objects ``` import plotly.plotly as py from plotly.figure_factory import create_ohlc from datetime import datetime # Add data open_data = [33.0, 33.3, 33.5, 33.0, 34.1] high_data = [33.1, 33.3, 33.6, 33.2, 34.8] low_data = [32.7, 32.7, 32.8, 32.6, 32.8] close_data = [33.0, 32.9, 33.3, 33.1, 33.1] dates = [datetime(year=2013, month=10, day=10), datetime(year=2013, month=11, day=10), datetime(year=2013, month=12, day=10), datetime(year=2014, month=1, day=10), datetime(year=2014, month=2, day=10)] # Create ohlc fig = create_ohlc(open_data, high_data, low_data, close_data, dates=dates) py.iplot(fig, filename='finance/simple-ohlc', validate=False) ``` """ if dates is not None: utils.validate_equal_length(open, high, low, close, dates) else: utils.validate_equal_length(open, high, low, close) validate_ohlc(open, high, low, close, direction, **kwargs) if direction is 'increasing': ohlc_incr = make_increasing_ohlc(open, high, low, close, dates, **kwargs) data = [ohlc_incr] elif direction is 'decreasing': ohlc_decr = make_decreasing_ohlc(open, high, low, close, dates, **kwargs) data = [ohlc_decr] else: ohlc_incr = make_increasing_ohlc(open, high, low, close, dates, **kwargs) ohlc_decr = make_decreasing_ohlc(open, high, low, close, dates, **kwargs) data = [ohlc_incr, ohlc_decr] layout = graph_objs.Layout(xaxis=dict(zeroline=False), hovermode='closest') return graph_objs.Figure(data=data, layout=layout) class _OHLC(object): """ Refer to FigureFactory.create_ohlc_increase() for docstring. """ def __init__(self, open, high, low, close, dates, **kwargs): self.open = open self.high = high self.low = low self.close = close self.empty = [None] * len(open) self.dates = dates self.all_x = [] self.all_y = [] self.increase_x = [] self.increase_y = [] self.decrease_x = [] self.decrease_y = [] self.get_all_xy() self.separate_increase_decrease() def get_all_xy(self): """ Zip data to create OHLC shape OHLC shape: low to high vertical bar with horizontal branches for open and close values. If dates were added, the smallest date difference is calculated and multiplied by .2 to get the length of the open and close branches. If no date data was provided, the x-axis is a list of integers and the length of the open and close branches is .2. """ self.all_y = list(zip(self.open, self.open, self.high, self.low, self.close, self.close, self.empty)) if self.dates is not None: date_dif = [] for i in range(len(self.dates) - 1): date_dif.append(self.dates[i + 1] - self.dates[i]) date_dif_min = (min(date_dif)) / 5 self.all_x = [[x - date_dif_min, x, x, x, x, x + date_dif_min, None] for x in self.dates] else: self.all_x = [[x - .2, x, x, x, x, x + .2, None] for x in range(len(self.open))] def separate_increase_decrease(self): """ Separate data into two groups: increase and decrease (1) Increase, where close > open and (2) Decrease, where close <= open """ for index in range(len(self.open)): if self.close[index] is None: pass elif self.close[index] > self.open[index]: self.increase_x.append(self.all_x[index]) self.increase_y.append(self.all_y[index]) else: self.decrease_x.append(self.all_x[index]) self.decrease_y.append(self.all_y[index]) def get_increase(self): """ Flatten increase data and get increase text :rtype (list, list, list): flat_increase_x: x-values for the increasing trace, flat_increase_y: y=values for the increasing trace and text_increase: hovertext for the increasing trace """ flat_increase_x = utils.flatten(self.increase_x) flat_increase_y = utils.flatten(self.increase_y) text_increase = (("Open", "Open", "High", "Low", "Close", "Close", '') * (len(self.increase_x))) return flat_increase_x, flat_increase_y, text_increase def get_decrease(self): """ Flatten decrease data and get decrease text :rtype (list, list, list): flat_decrease_x: x-values for the decreasing trace, flat_decrease_y: y=values for the decreasing trace and text_decrease: hovertext for the decreasing trace """ flat_decrease_x = utils.flatten(self.decrease_x) flat_decrease_y = utils.flatten(self.decrease_y) text_decrease = (("Open", "Open", "High", "Low", "Close", "Close", '') * (len(self.decrease_x))) return flat_decrease_x, flat_decrease_y, text_decrease plotly-2.2.3+dfsg.orig/plotly/figure_factory/_facet_grid.py0000644000175000017500000011622513207065466023422 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly import colors, exceptions, optional_imports from plotly.figure_factory import utils from plotly.graph_objs import graph_objs from plotly.tools import make_subplots import math import copy from numbers import Number pd = optional_imports.get_module('pandas') TICK_COLOR = '#969696' AXIS_TITLE_COLOR = '#0f0f0f' AXIS_TITLE_SIZE = 12 GRID_COLOR = '#ffffff' LEGEND_COLOR = '#efefef' PLOT_BGCOLOR = '#ededed' ANNOT_RECT_COLOR = '#d0d0d0' LEGEND_BORDER_WIDTH = 1 LEGEND_ANNOT_X = 1.05 LEGEND_ANNOT_Y = 0.5 MAX_TICKS_PER_AXIS = 5 THRES_FOR_FLIPPED_FACET_TITLES = 10 GRID_WIDTH = 1 VALID_TRACE_TYPES = ['scatter', 'scattergl', 'histogram', 'bar', 'box'] CUSTOM_LABEL_ERROR = ( "If you are using a dictionary for custom labels for the facet row/col, " "make sure each key in that column of the dataframe is in your facet " "labels. The keys you need are {}" ) def _is_flipped(num): if num >= THRES_FOR_FLIPPED_FACET_TITLES: flipped = True else: flipped = False return flipped def _return_label(original_label, facet_labels, facet_var): if isinstance(facet_labels, dict): label = facet_labels[original_label] elif isinstance(facet_labels, str): label = '{}: {}'.format(facet_var, original_label) else: label = original_label return label def _legend_annotation(color_name): legend_title = dict( textangle=0, xanchor='left', yanchor='middle', x=LEGEND_ANNOT_X, y=1.03, showarrow=False, xref='paper', yref='paper', text='factor({})'.format(color_name), font=dict( size=13, color='#000000' ) ) return legend_title def _annotation_dict(text, lane, num_of_lanes, SUBPLOT_SPACING, row_col='col', flipped=True): l = (1 - (num_of_lanes - 1) * SUBPLOT_SPACING) / (num_of_lanes) if not flipped: xanchor = 'center' yanchor = 'middle' if row_col == 'col': x = (lane - 1) * (l + SUBPLOT_SPACING) + 0.5 * l y = 1.03 textangle = 0 elif row_col == 'row': y = (lane - 1) * (l + SUBPLOT_SPACING) + 0.5 * l x = 1.03 textangle = 90 else: if row_col == 'col': xanchor = 'center' yanchor = 'bottom' x = (lane - 1) * (l + SUBPLOT_SPACING) + 0.5 * l y = 1.0 textangle = 270 elif row_col == 'row': xanchor = 'left' yanchor = 'middle' y = (lane - 1) * (l + SUBPLOT_SPACING) + 0.5 * l x = 1.0 textangle = 0 annotation_dict = dict( textangle=textangle, xanchor=xanchor, yanchor=yanchor, x=x, y=y, showarrow=False, xref='paper', yref='paper', text=text, font=dict( size=13, color=AXIS_TITLE_COLOR ) ) return annotation_dict def _axis_title_annotation(text, x_or_y_axis): if x_or_y_axis == 'x': x_pos = 0.5 y_pos = -0.1 textangle = 0 elif x_or_y_axis == 'y': x_pos = -0.1 y_pos = 0.5 textangle = 270 if not text: text = '' annot = {'font': {'color': '#000000', 'size': AXIS_TITLE_SIZE}, 'showarrow': False, 'text': text, 'textangle': textangle, 'x': x_pos, 'xanchor': 'center', 'xref': 'paper', 'y': y_pos, 'yanchor': 'middle', 'yref': 'paper'} return annot def _add_shapes_to_fig(fig, annot_rect_color, flipped_rows=False, flipped_cols=False): fig['layout']['shapes'] = [] for key in fig['layout'].keys(): if 'axis' in key and fig['layout'][key]['domain'] != [0.0, 1.0]: shape = { 'fillcolor': annot_rect_color, 'layer': 'below', 'line': {'color': annot_rect_color, 'width': 1}, 'type': 'rect', 'xref': 'paper', 'yref': 'paper' } if 'xaxis' in key: shape['x0'] = fig['layout'][key]['domain'][0] shape['x1'] = fig['layout'][key]['domain'][1] shape['y0'] = 1.005 shape['y1'] = 1.05 if flipped_cols: shape['y1'] += 0.5 fig['layout']['shapes'].append(shape) elif 'yaxis' in key: shape['x0'] = 1.005 shape['x1'] = 1.05 shape['y0'] = fig['layout'][key]['domain'][0] shape['y1'] = fig['layout'][key]['domain'][1] if flipped_rows: shape['x1'] += 1 fig['layout']['shapes'].append(shape) def _make_trace_for_scatter(trace, trace_type, color, **kwargs_marker): if trace_type in ['scatter', 'scattergl']: trace['mode'] = 'markers' trace['marker'] = dict(color=color, **kwargs_marker) return trace def _facet_grid_color_categorical(df, x, y, facet_row, facet_col, color_name, colormap, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker): fig = make_subplots(rows=num_of_rows, cols=num_of_cols, shared_xaxes=True, shared_yaxes=True, horizontal_spacing=SUBPLOT_SPACING, vertical_spacing=SUBPLOT_SPACING, print_grid=False) annotations = [] if not facet_row and not facet_col: color_groups = list(df.groupby(color_name)) for group in color_groups: trace = dict( type=trace_type, name=group[0], marker=dict( color=colormap[group[0]], ), **kwargs_trace ) if x: trace['x'] = group[1][x] if y: trace['y'] = group[1][y] trace = _make_trace_for_scatter( trace, trace_type, colormap[group[0]], **kwargs_marker ) fig.append_trace(trace, 1, 1) elif (facet_row and not facet_col) or (not facet_row and facet_col): groups_by_facet = list( df.groupby(facet_row if facet_row else facet_col) ) for j, group in enumerate(groups_by_facet): for color_val in df[color_name].unique(): data_by_color = group[1][group[1][color_name] == color_val] trace = dict( type=trace_type, name=color_val, marker=dict( color=colormap[color_val], ), **kwargs_trace ) if x: trace['x'] = data_by_color[x] if y: trace['y'] = data_by_color[y] trace = _make_trace_for_scatter( trace, trace_type, colormap[color_val], **kwargs_marker ) fig.append_trace(trace, j + 1 if facet_row else 1, 1 if facet_row else j + 1) label = _return_label( group[0], facet_row_labels if facet_row else facet_col_labels, facet_row if facet_row else facet_col ) annotations.append( _annotation_dict( label, num_of_rows - j if facet_row else j + 1, num_of_rows if facet_row else num_of_cols, SUBPLOT_SPACING, 'row' if facet_row else 'col', flipped_rows) ) elif facet_row and facet_col: groups_by_facets = list(df.groupby([facet_row, facet_col])) tuple_to_facet_group = {item[0]: item[1] for item in groups_by_facets} row_values = df[facet_row].unique() col_values = df[facet_col].unique() color_vals = df[color_name].unique() for row_count, x_val in enumerate(row_values): for col_count, y_val in enumerate(col_values): try: group = tuple_to_facet_group[(x_val, y_val)] except KeyError: group = pd.DataFrame([[None, None, None]], columns=[x, y, color_name]) for color_val in color_vals: if group.values.tolist() != [[None, None, None]]: group_filtered = group[group[color_name] == color_val] trace = dict( type=trace_type, name=color_val, marker=dict( color=colormap[color_val], ), **kwargs_trace ) new_x = group_filtered[x] new_y = group_filtered[y] else: trace = dict( type=trace_type, name=color_val, marker=dict( color=colormap[color_val], ), showlegend=False, **kwargs_trace ) new_x = group[x] new_y = group[y] if x: trace['x'] = new_x if y: trace['y'] = new_y trace = _make_trace_for_scatter( trace, trace_type, colormap[color_val], **kwargs_marker ) fig.append_trace(trace, row_count + 1, col_count + 1) if row_count == 0: label = _return_label(col_values[col_count], facet_col_labels, facet_col) annotations.append( _annotation_dict(label, col_count + 1, num_of_cols, SUBPLOT_SPACING, row_col='col', flipped=flipped_cols) ) label = _return_label(row_values[row_count], facet_row_labels, facet_row) annotations.append( _annotation_dict(label, num_of_rows - row_count, num_of_rows, SUBPLOT_SPACING, row_col='row', flipped=flipped_rows) ) # add annotations fig['layout']['annotations'] = annotations return fig def _facet_grid_color_numerical(df, x, y, facet_row, facet_col, color_name, colormap, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker): fig = make_subplots(rows=num_of_rows, cols=num_of_cols, shared_xaxes=True, shared_yaxes=True, horizontal_spacing=SUBPLOT_SPACING, vertical_spacing=SUBPLOT_SPACING, print_grid=False) annotations = [] if not facet_row and not facet_col: trace = dict( type=trace_type, marker=dict( color=df[color_name], colorscale=colormap, showscale=True, ), **kwargs_trace ) if x: trace['x'] = df[x] if y: trace['y'] = df[y] trace = _make_trace_for_scatter( trace, trace_type, df[color_name], **kwargs_marker ) fig.append_trace(trace, 1, 1) if (facet_row and not facet_col) or (not facet_row and facet_col): groups_by_facet = list( df.groupby(facet_row if facet_row else facet_col) ) for j, group in enumerate(groups_by_facet): trace = dict( type=trace_type, marker=dict( color=df[color_name], colorscale=colormap, showscale=True, colorbar=dict(x=1.15), ), **kwargs_trace ) if x: trace['x'] = group[1][x] if y: trace['y'] = group[1][y] trace = _make_trace_for_scatter( trace, trace_type, df[color_name], **kwargs_marker ) fig.append_trace( trace, j + 1 if facet_row else 1, 1 if facet_row else j + 1 ) labels = facet_row_labels if facet_row else facet_col_labels label = _return_label( group[0], labels, facet_row if facet_row else facet_col ) annotations.append( _annotation_dict( label, num_of_rows - j if facet_row else j + 1, num_of_rows if facet_row else num_of_cols, SUBPLOT_SPACING, 'row' if facet_row else 'col', flipped=flipped_rows) ) elif facet_row and facet_col: groups_by_facets = list(df.groupby([facet_row, facet_col])) tuple_to_facet_group = {item[0]: item[1] for item in groups_by_facets} row_values = df[facet_row].unique() col_values = df[facet_col].unique() for row_count, x_val in enumerate(row_values): for col_count, y_val in enumerate(col_values): try: group = tuple_to_facet_group[(x_val, y_val)] except KeyError: group = pd.DataFrame([[None, None, None]], columns=[x, y, color_name]) if group.values.tolist() != [[None, None, None]]: trace = dict( type=trace_type, marker=dict( color=df[color_name], colorscale=colormap, showscale=(row_count == 0), colorbar=dict(x=1.15), ), **kwargs_trace ) else: trace = dict( type=trace_type, showlegend=False, **kwargs_trace ) if x: trace['x'] = group[x] if y: trace['y'] = group[y] trace = _make_trace_for_scatter( trace, trace_type, df[color_name], **kwargs_marker ) fig.append_trace(trace, row_count + 1, col_count + 1) if row_count == 0: label = _return_label(col_values[col_count], facet_col_labels, facet_col) annotations.append( _annotation_dict(label, col_count + 1, num_of_cols, SUBPLOT_SPACING, row_col='col', flipped=flipped_cols) ) label = _return_label(row_values[row_count], facet_row_labels, facet_row) annotations.append( _annotation_dict(row_values[row_count], num_of_rows - row_count, num_of_rows, SUBPLOT_SPACING, row_col='row', flipped=flipped_rows) ) # add annotations fig['layout']['annotations'] = annotations return fig def _facet_grid(df, x, y, facet_row, facet_col, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker): fig = make_subplots(rows=num_of_rows, cols=num_of_cols, shared_xaxes=True, shared_yaxes=True, horizontal_spacing=SUBPLOT_SPACING, vertical_spacing=SUBPLOT_SPACING, print_grid=False) annotations = [] if not facet_row and not facet_col: trace = dict( type=trace_type, marker=dict( color=marker_color, line=kwargs_marker['line'], ), **kwargs_trace ) if x: trace['x'] = df[x] if y: trace['y'] = df[y] trace = _make_trace_for_scatter( trace, trace_type, marker_color, **kwargs_marker ) fig.append_trace(trace, 1, 1) elif (facet_row and not facet_col) or (not facet_row and facet_col): groups_by_facet = list( df.groupby(facet_row if facet_row else facet_col) ) for j, group in enumerate(groups_by_facet): trace = dict( type=trace_type, marker=dict( color=marker_color, line=kwargs_marker['line'], ), **kwargs_trace ) if x: trace['x'] = group[1][x] if y: trace['y'] = group[1][y] trace = _make_trace_for_scatter( trace, trace_type, marker_color, **kwargs_marker ) fig.append_trace(trace, j + 1 if facet_row else 1, 1 if facet_row else j + 1) label = _return_label( group[0], facet_row_labels if facet_row else facet_col_labels, facet_row if facet_row else facet_col ) annotations.append( _annotation_dict( label, num_of_rows - j if facet_row else j + 1, num_of_rows if facet_row else num_of_cols, SUBPLOT_SPACING, 'row' if facet_row else 'col', flipped_rows ) ) elif facet_row and facet_col: groups_by_facets = list(df.groupby([facet_row, facet_col])) tuple_to_facet_group = {item[0]: item[1] for item in groups_by_facets} row_values = df[facet_row].unique() col_values = df[facet_col].unique() for row_count, x_val in enumerate(row_values): for col_count, y_val in enumerate(col_values): try: group = tuple_to_facet_group[(x_val, y_val)] except KeyError: group = pd.DataFrame([[None, None]], columns=[x, y]) trace = dict( type=trace_type, marker=dict( color=marker_color, line=kwargs_marker['line'], ), **kwargs_trace ) if x: trace['x'] = group[x] if y: trace['y'] = group[y] trace = _make_trace_for_scatter( trace, trace_type, marker_color, **kwargs_marker ) fig.append_trace(trace, row_count + 1, col_count + 1) if row_count == 0: label = _return_label(col_values[col_count], facet_col_labels, facet_col) annotations.append( _annotation_dict(label, col_count + 1, num_of_cols, SUBPLOT_SPACING, row_col='col', flipped=flipped_cols) ) label = _return_label(row_values[row_count], facet_row_labels, facet_row) annotations.append( _annotation_dict(label, num_of_rows - row_count, num_of_rows, SUBPLOT_SPACING, row_col='row', flipped=flipped_rows) ) # add annotations fig['layout']['annotations'] = annotations return fig def create_facet_grid(df, x=None, y=None, facet_row=None, facet_col=None, color_name=None, colormap=None, color_is_cat=False, facet_row_labels=None, facet_col_labels=None, height=None, width=None, trace_type='scatter', scales='fixed', dtick_x=None, dtick_y=None, show_boxes=True, ggplot2=False, binsize=1, **kwargs): """ Returns figure for facet grid. :param (pd.DataFrame) df: the dataframe of columns for the facet grid. :param (str) x: the name of the dataframe column for the x axis data. :param (str) y: the name of the dataframe column for the y axis data. :param (str) facet_row: the name of the dataframe column that is used to facet the grid into row panels. :param (str) facet_col: the name of the dataframe column that is used to facet the grid into column panels. :param (str) color_name: the name of your dataframe column that will function as the colormap variable. :param (str|list|dict) colormap: the param that determines how the color_name column colors the data. If the dataframe contains numeric data, then a dictionary of colors will group the data categorically while a Plotly Colorscale name or a custom colorscale will treat it numerically. To learn more about colors and types of colormap, run `help(plotly.colors)`. :param (bool) color_is_cat: determines whether a numerical column for the colormap will be treated as categorical (True) or sequential (False). Default = False. :param (str|dict) facet_row_labels: set to either 'name' or a dictionary of all the unique values in the faceting row mapped to some text to show up in the label annotations. If None, labeling works like usual. :param (str|dict) facet_col_labels: set to either 'name' or a dictionary of all the values in the faceting row mapped to some text to show up in the label annotations. If None, labeling works like usual. :param (int) height: the height of the facet grid figure. :param (int) width: the width of the facet grid figure. :param (str) trace_type: decides the type of plot to appear in the facet grid. The options are 'scatter', 'scattergl', 'histogram', 'bar', and 'box'. Default = 'scatter'. :param (str) scales: determines if axes have fixed ranges or not. Valid settings are 'fixed' (all axes fixed), 'free_x' (x axis free only), 'free_y' (y axis free only) or 'free' (both axes free). :param (float) dtick_x: determines the distance between each tick on the x-axis. Default is None which means dtick_x is set automatically. :param (float) dtick_y: determines the distance between each tick on the y-axis. Default is None which means dtick_y is set automatically. :param (bool) show_boxes: draws grey boxes behind the facet titles. :param (bool) ggplot2: draws the facet grid in the style of `ggplot2`. See http://ggplot2.tidyverse.org/reference/facet_grid.html for reference. Default = False :param (int) binsize: groups all data into bins of a given length. :param (dict) kwargs: a dictionary of scatterplot arguments. Examples 1: One Way Faceting ``` import plotly.plotly as py import plotly.figure_factory as ff import pandas as pd mpg = pd.read_table('https://raw.githubusercontent.com/plotly/datasets/master/mpg_2017.txt') fig = ff.create_facet_grid( mpg, x='displ', y='cty', facet_col='cyl', ) py.iplot(fig, filename='facet_grid_mpg_one_way_facet') ``` Example 2: Two Way Faceting ``` import plotly.plotly as py import plotly.figure_factory as ff import pandas as pd mpg = pd.read_table('https://raw.githubusercontent.com/plotly/datasets/master/mpg_2017.txt') fig = ff.create_facet_grid( mpg, x='displ', y='cty', facet_row='drv', facet_col='cyl', ) py.iplot(fig, filename='facet_grid_mpg_two_way_facet') ``` Example 3: Categorical Coloring ``` import plotly.plotly as py import plotly.figure_factory as ff import pandas as pd mpg = pd.read_table('https://raw.githubusercontent.com/plotly/datasets/master/mpg_2017.txt') fig = ff.create_facet_grid( mtcars, x='mpg', y='wt', facet_col='cyl', color_name='cyl', color_is_cat=True, ) py.iplot(fig, filename='facet_grid_mpg_default_colors') ``` Example 4: Sequential Coloring ``` import plotly.plotly as py import plotly.figure_factory as ff import pandas as pd tips = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/tips.csv') fig = ff.create_facet_grid( tips, x='total_bill', y='tip', facet_row='sex', facet_col='smoker', color_name='size', colormap='Viridis', ) py.iplot(fig, filename='facet_grid_tips_sequential_colors') ``` Example 5: Custom labels ``` import plotly.plotly as py import plotly.figure_factory as ff import pandas as pd mtcars = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/mtcars.csv') fig = ff.create_facet_grid( mtcars, x='wt', y='mpg', facet_col='cyl', facet_col_labels={4: "$\\alpha$", 6: '$\\beta$', 8: '$\sqrt[y]{x}$'}, ) py.iplot(fig, filename='facet_grid_mtcars_custom_labels') ``` Example 6: Other Trace Type ``` import plotly.plotly as py import plotly.figure_factory as ff import pandas as pd mtcars = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/mtcars.csv') fig = ff.create_facet_grid( mtcars, x='wt', facet_col='cyl', trace_type='histogram', ) py.iplot(fig, filename='facet_grid_mtcars_other_trace_type') ``` """ if not pd: raise exceptions.ImportError( "'pandas' must be installed for this figure_factory." ) if not isinstance(df, pd.DataFrame): raise exceptions.PlotlyError( "You must input a pandas DataFrame." ) # make sure all columns are of homogenous datatype utils.validate_dataframe(df) if trace_type in ['scatter', 'scattergl']: if not x or not y: raise exceptions.PlotlyError( "You need to input 'x' and 'y' if you are you are using a " "trace_type of 'scatter' or 'scattergl'." ) for key in [x, y, facet_row, facet_col, color_name]: if key is not None: try: df[key] except KeyError: raise exceptions.PlotlyError( "x, y, facet_row, facet_col and color_name must be keys " "in your dataframe." ) # autoscale histogram bars if trace_type not in ['scatter', 'scattergl']: scales = 'free' # validate scales if scales not in ['fixed', 'free_x', 'free_y', 'free']: raise exceptions.PlotlyError( "'scales' must be set to 'fixed', 'free_x', 'free_y' and 'free'." ) if trace_type not in VALID_TRACE_TYPES: raise exceptions.PlotlyError( "'trace_type' must be in {}".format(VALID_TRACE_TYPES) ) if trace_type == 'histogram': SUBPLOT_SPACING = 0.06 else: SUBPLOT_SPACING = 0.015 # seperate kwargs for marker and else if 'marker' in kwargs: kwargs_marker = kwargs['marker'] else: kwargs_marker = {} marker_color = kwargs_marker.pop('color', None) kwargs.pop('marker', None) kwargs_trace = kwargs if 'size' not in kwargs_marker: if ggplot2: kwargs_marker['size'] = 5 else: kwargs_marker['size'] = 8 if 'opacity' not in kwargs_marker: if not ggplot2: kwargs_trace['opacity'] = 0.6 if 'line' not in kwargs_marker: if not ggplot2: kwargs_marker['line'] = {'color': 'darkgrey', 'width': 1} else: kwargs_marker['line'] = {} # default marker size if not ggplot2: if not marker_color: marker_color = 'rgb(31, 119, 180)' else: marker_color = 'rgb(0, 0, 0)' num_of_rows = 1 num_of_cols = 1 flipped_rows = False flipped_cols = False if facet_row: num_of_rows = len(df[facet_row].unique()) flipped_rows = _is_flipped(num_of_rows) if isinstance(facet_row_labels, dict): for key in df[facet_row].unique(): if key not in facet_row_labels.keys(): unique_keys = df[facet_row].unique().tolist() raise exceptions.PlotlyError( CUSTOM_LABEL_ERROR.format(unique_keys) ) if facet_col: num_of_cols = len(df[facet_col].unique()) flipped_cols = _is_flipped(num_of_cols) if isinstance(facet_col_labels, dict): for key in df[facet_col].unique(): if key not in facet_col_labels.keys(): unique_keys = df[facet_col].unique().tolist() raise exceptions.PlotlyError( CUSTOM_LABEL_ERROR.format(unique_keys) ) show_legend = False if color_name: if isinstance(df[color_name].iloc[0], str) or color_is_cat: show_legend = True if isinstance(colormap, dict): utils.validate_colors_dict(colormap, 'rgb') for val in df[color_name].unique(): if val not in colormap.keys(): raise exceptions.PlotlyError( "If using 'colormap' as a dictionary, make sure " "all the values of the colormap column are in " "the keys of your dictionary." ) else: # use default plotly colors for dictionary default_colors = utils.DEFAULT_PLOTLY_COLORS colormap = {} j = 0 for val in df[color_name].unique(): if j >= len(default_colors): j = 0 colormap[val] = default_colors[j] j += 1 fig = _facet_grid_color_categorical( df, x, y, facet_row, facet_col, color_name, colormap, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker ) elif isinstance(df[color_name].iloc[0], Number): if isinstance(colormap, dict): show_legend = True utils.validate_colors_dict(colormap, 'rgb') for val in df[color_name].unique(): if val not in colormap.keys(): raise exceptions.PlotlyError( "If using 'colormap' as a dictionary, make sure " "all the values of the colormap column are in " "the keys of your dictionary." ) fig = _facet_grid_color_categorical( df, x, y, facet_row, facet_col, color_name, colormap, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker ) elif isinstance(colormap, list): colorscale_list = colormap utils.validate_colorscale(colorscale_list) fig = _facet_grid_color_numerical( df, x, y, facet_row, facet_col, color_name, colorscale_list, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker ) elif isinstance(colormap, str): if colormap in colors.PLOTLY_SCALES.keys(): colorscale_list = colors.PLOTLY_SCALES[colormap] else: raise exceptions.PlotlyError( "If 'colormap' is a string, it must be the name " "of a Plotly Colorscale. The available colorscale " "names are {}".format(colors.PLOTLY_SCALES.keys()) ) fig = _facet_grid_color_numerical( df, x, y, facet_row, facet_col, color_name, colorscale_list, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker ) else: colorscale_list = colors.PLOTLY_SCALES['Reds'] fig = _facet_grid_color_numerical( df, x, y, facet_row, facet_col, color_name, colorscale_list, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker ) else: fig = _facet_grid( df, x, y, facet_row, facet_col, num_of_rows, num_of_cols, facet_row_labels, facet_col_labels, trace_type, flipped_rows, flipped_cols, show_boxes, SUBPLOT_SPACING, marker_color, kwargs_trace, kwargs_marker ) if not height: height = max(600, 100 * num_of_rows) if not width: width = max(600, 100 * num_of_cols) fig['layout'].update(height=height, width=width, title='', paper_bgcolor='rgb(251, 251, 251)') if ggplot2: fig['layout'].update(plot_bgcolor=PLOT_BGCOLOR, paper_bgcolor='rgb(255, 255, 255)', hovermode='closest') # axis titles x_title_annot = _axis_title_annotation(x, 'x') y_title_annot = _axis_title_annotation(y, 'y') fig['layout']['annotations'].append(x_title_annot) fig['layout']['annotations'].append(y_title_annot) # legend fig['layout']['showlegend'] = show_legend fig['layout']['legend']['bgcolor'] = LEGEND_COLOR fig['layout']['legend']['borderwidth'] = LEGEND_BORDER_WIDTH fig['layout']['legend']['x'] = 1.05 fig['layout']['legend']['y'] = 1 fig['layout']['legend']['yanchor'] = 'top' if show_legend: fig['layout']['showlegend'] = show_legend if ggplot2: if color_name: legend_annot = _legend_annotation(color_name) fig['layout']['annotations'].append(legend_annot) fig['layout']['margin']['r'] = 150 # add shaded boxes behind axis titles if show_boxes and ggplot2: _add_shapes_to_fig(fig, ANNOT_RECT_COLOR, flipped_rows, flipped_cols) # all xaxis and yaxis labels axis_labels = {'x': [], 'y': []} for key in fig['layout']: if 'xaxis' in key: axis_labels['x'].append(key) elif 'yaxis' in key: axis_labels['y'].append(key) string_number_in_data = False for var in [v for v in [x, y] if v]: if isinstance(df[var].tolist()[0], str): for item in df[var]: try: int(item) string_number_in_data = True except ValueError: pass if string_number_in_data: for x_y in axis_labels.keys(): for axis_name in axis_labels[x_y]: fig['layout'][axis_name]['type'] = 'category' if scales == 'fixed': fixed_axes = ['x', 'y'] elif scales == 'free_x': fixed_axes = ['y'] elif scales == 'free_y': fixed_axes = ['x'] elif scales == 'free': fixed_axes = [] # fixed ranges for x_y in fixed_axes: min_ranges = [] max_ranges = [] for trace in fig['data']: if trace[x_y] is not None and len(trace[x_y]) > 0: min_ranges.append(min(trace[x_y])) max_ranges.append(max(trace[x_y])) while None in min_ranges: min_ranges.remove(None) while None in max_ranges: max_ranges.remove(None) min_range = min(min_ranges) max_range = max(max_ranges) range_are_numbers = (isinstance(min_range, Number) and isinstance(max_range, Number)) if range_are_numbers: min_range = math.floor(min_range) max_range = math.ceil(max_range) # extend widen frame by 5% on each side min_range -= 0.05 * (max_range - min_range) max_range += 0.05 * (max_range - min_range) if x_y == 'x': if dtick_x: dtick = dtick_x else: dtick = math.floor( (max_range - min_range) / MAX_TICKS_PER_AXIS ) elif x_y == 'y': if dtick_y: dtick = dtick_y else: dtick = math.floor( (max_range - min_range) / MAX_TICKS_PER_AXIS ) else: dtick = 1 for axis_title in axis_labels[x_y]: fig['layout'][axis_title]['dtick'] = dtick fig['layout'][axis_title]['ticklen'] = 0 fig['layout'][axis_title]['zeroline'] = False if ggplot2: fig['layout'][axis_title]['tickwidth'] = 1 fig['layout'][axis_title]['ticklen'] = 4 fig['layout'][axis_title]['gridwidth'] = GRID_WIDTH fig['layout'][axis_title]['gridcolor'] = GRID_COLOR fig['layout'][axis_title]['gridwidth'] = 2 fig['layout'][axis_title]['tickfont'] = { 'color': TICK_COLOR, 'size': 10 } # insert ranges into fig if x_y in fixed_axes: for key in fig['layout']: if '{}axis'.format(x_y) in key and range_are_numbers: fig['layout'][key]['range'] = [min_range, max_range] return fig plotly-2.2.3+dfsg.orig/plotly/figure_factory/_gantt.py0000644000175000017500000006457513174436011022451 0ustar noahfxnoahfxfrom __future__ import absolute_import from numbers import Number from plotly import exceptions, optional_imports from plotly.figure_factory import utils from plotly.graph_objs import graph_objs pd = optional_imports.get_module('pandas') REQUIRED_GANTT_KEYS = ['Task', 'Start', 'Finish'] def validate_gantt(df): """ Validates the inputted dataframe or list """ if pd and isinstance(df, pd.core.frame.DataFrame): # validate that df has all the required keys for key in REQUIRED_GANTT_KEYS: if key not in df: raise exceptions.PlotlyError( "The columns in your dataframe must include the " "following keys: {0}".format( ', '.join(REQUIRED_GANTT_KEYS)) ) num_of_rows = len(df.index) chart = [] for index in range(num_of_rows): task_dict = {} for key in df: task_dict[key] = df.ix[index][key] chart.append(task_dict) return chart # validate if df is a list if not isinstance(df, list): raise exceptions.PlotlyError("You must input either a dataframe " "or a list of dictionaries.") # validate if df is empty if len(df) <= 0: raise exceptions.PlotlyError("Your list is empty. It must contain " "at least one dictionary.") if not isinstance(df[0], dict): raise exceptions.PlotlyError("Your list must only " "include dictionaries.") return df def gantt(chart, colors, title, bar_width, showgrid_x, showgrid_y, height, width, tasks=None, task_names=None, data=None, group_tasks=False): """ Refer to create_gantt() for docstring """ if tasks is None: tasks = [] if task_names is None: task_names = [] if data is None: data = [] for index in range(len(chart)): task = dict(x0=chart[index]['Start'], x1=chart[index]['Finish'], name=chart[index]['Task']) if 'Description' in chart[index]: task['description'] = chart[index]['Description'] tasks.append(task) shape_template = { 'type': 'rect', 'xref': 'x', 'yref': 'y', 'opacity': 1, 'line': { 'width': 0, } } # create the list of task names for index in range(len(tasks)): tn = tasks[index]['name'] # Is added to task_names if group_tasks is set to False, # or if the option is used (True) it only adds them if the # name is not already in the list if not group_tasks or tn not in task_names: task_names.append(tn) # Guarantees that for grouped tasks the tasks that are inserted first # are shown at the top if group_tasks: task_names.reverse() color_index = 0 for index in range(len(tasks)): tn = tasks[index]['name'] del tasks[index]['name'] tasks[index].update(shape_template) # If group_tasks is True, all tasks with the same name belong # to the same row. groupID = index if group_tasks: groupID = task_names.index(tn) tasks[index]['y0'] = groupID - bar_width tasks[index]['y1'] = groupID + bar_width # check if colors need to be looped if color_index >= len(colors): color_index = 0 tasks[index]['fillcolor'] = colors[color_index] # Add a line for hover text and autorange entry = dict( x=[tasks[index]['x0'], tasks[index]['x1']], y=[groupID, groupID], name='', marker={'color': 'white'} ) if "description" in tasks[index]: entry['text'] = tasks[index]['description'] del tasks[index]['description'] data.append(entry) color_index += 1 layout = dict( title=title, showlegend=False, height=height, width=width, shapes=[], hovermode='closest', yaxis=dict( showgrid=showgrid_y, ticktext=task_names, tickvals=list(range(len(task_names))), range=[-1, len(task_names) + 1], autorange=False, zeroline=False, ), xaxis=dict( showgrid=showgrid_x, zeroline=False, rangeselector=dict( buttons=list([ dict(count=7, label='1w', step='day', stepmode='backward'), dict(count=1, label='1m', step='month', stepmode='backward'), dict(count=6, label='6m', step='month', stepmode='backward'), dict(count=1, label='YTD', step='year', stepmode='todate'), dict(count=1, label='1y', step='year', stepmode='backward'), dict(step='all') ]) ), type='date' ) ) layout['shapes'] = tasks fig = graph_objs.Figure(data=data, layout=layout) return fig def gantt_colorscale(chart, colors, title, index_col, show_colorbar, bar_width, showgrid_x, showgrid_y, height, width, tasks=None, task_names=None, data=None, group_tasks=False): """ Refer to FigureFactory.create_gantt() for docstring """ if tasks is None: tasks = [] if task_names is None: task_names = [] if data is None: data = [] showlegend = False for index in range(len(chart)): task = dict(x0=chart[index]['Start'], x1=chart[index]['Finish'], name=chart[index]['Task']) if 'Description' in chart[index]: task['description'] = chart[index]['Description'] tasks.append(task) shape_template = { 'type': 'rect', 'xref': 'x', 'yref': 'y', 'opacity': 1, 'line': { 'width': 0, } } # compute the color for task based on indexing column if isinstance(chart[0][index_col], Number): # check that colors has at least 2 colors if len(colors) < 2: raise exceptions.PlotlyError( "You must use at least 2 colors in 'colors' if you " "are using a colorscale. However only the first two " "colors given will be used for the lower and upper " "bounds on the colormap." ) # create the list of task names for index in range(len(tasks)): tn = tasks[index]['name'] # Is added to task_names if group_tasks is set to False, # or if the option is used (True) it only adds them if the # name is not already in the list if not group_tasks or tn not in task_names: task_names.append(tn) # Guarantees that for grouped tasks the tasks that are inserted # first are shown at the top if group_tasks: task_names.reverse() for index in range(len(tasks)): tn = tasks[index]['name'] del tasks[index]['name'] tasks[index].update(shape_template) # If group_tasks is True, all tasks with the same name belong # to the same row. groupID = index if group_tasks: groupID = task_names.index(tn) tasks[index]['y0'] = groupID - bar_width tasks[index]['y1'] = groupID + bar_width # unlabel color colors = utils.color_parser(colors, utils.unlabel_rgb) lowcolor = colors[0] highcolor = colors[1] intermed = (chart[index][index_col]) / 100.0 intermed_color = utils.find_intermediate_color( lowcolor, highcolor, intermed ) intermed_color = utils.color_parser( intermed_color, utils.label_rgb ) tasks[index]['fillcolor'] = intermed_color # relabel colors with 'rgb' colors = utils.color_parser(colors, utils.label_rgb) # add a line for hover text and autorange entry = dict( x=[tasks[index]['x0'], tasks[index]['x1']], y=[groupID, groupID], name='', marker={'color': 'white'} ) if "description" in tasks[index]: entry['text'] = tasks[index]['description'] del tasks[index]['description'] data.append(entry) if show_colorbar is True: # generate dummy data for colorscale visibility data.append( dict( x=[tasks[index]['x0'], tasks[index]['x0']], y=[index, index], name='', marker={'color': 'white', 'colorscale': [[0, colors[0]], [1, colors[1]]], 'showscale': True, 'cmax': 100, 'cmin': 0} ) ) if isinstance(chart[0][index_col], str): index_vals = [] for row in range(len(tasks)): if chart[row][index_col] not in index_vals: index_vals.append(chart[row][index_col]) index_vals.sort() if len(colors) < len(index_vals): raise exceptions.PlotlyError( "Error. The number of colors in 'colors' must be no less " "than the number of unique index values in your group " "column." ) # make a dictionary assignment to each index value index_vals_dict = {} # define color index c_index = 0 for key in index_vals: if c_index > len(colors) - 1: c_index = 0 index_vals_dict[key] = colors[c_index] c_index += 1 # create the list of task names for index in range(len(tasks)): tn = tasks[index]['name'] # Is added to task_names if group_tasks is set to False, # or if the option is used (True) it only adds them if the # name is not already in the list if not group_tasks or tn not in task_names: task_names.append(tn) # Guarantees that for grouped tasks the tasks that are inserted # first are shown at the top if group_tasks: task_names.reverse() for index in range(len(tasks)): tn = tasks[index]['name'] del tasks[index]['name'] tasks[index].update(shape_template) # If group_tasks is True, all tasks with the same name belong # to the same row. groupID = index if group_tasks: groupID = task_names.index(tn) tasks[index]['y0'] = groupID - bar_width tasks[index]['y1'] = groupID + bar_width tasks[index]['fillcolor'] = index_vals_dict[ chart[index][index_col] ] # add a line for hover text and autorange entry = dict( x=[tasks[index]['x0'], tasks[index]['x1']], y=[groupID, groupID], name='', marker={'color': 'white'} ) if "description" in tasks[index]: entry['text'] = tasks[index]['description'] del tasks[index]['description'] data.append(entry) if show_colorbar is True: # generate dummy data to generate legend showlegend = True for k, index_value in enumerate(index_vals): data.append( dict( x=[tasks[index]['x0'], tasks[index]['x0']], y=[k, k], showlegend=True, name=str(index_value), hoverinfo='none', marker=dict( color=colors[k], size=1 ) ) ) layout = dict( title=title, showlegend=showlegend, height=height, width=width, shapes=[], hovermode='closest', yaxis=dict( showgrid=showgrid_y, ticktext=task_names, tickvals=list(range(len(task_names))), range=[-1, len(task_names) + 1], autorange=False, zeroline=False, ), xaxis=dict( showgrid=showgrid_x, zeroline=False, rangeselector=dict( buttons=list([ dict(count=7, label='1w', step='day', stepmode='backward'), dict(count=1, label='1m', step='month', stepmode='backward'), dict(count=6, label='6m', step='month', stepmode='backward'), dict(count=1, label='YTD', step='year', stepmode='todate'), dict(count=1, label='1y', step='year', stepmode='backward'), dict(step='all') ]) ), type='date' ) ) layout['shapes'] = tasks fig = dict(data=data, layout=layout) return fig def gantt_dict(chart, colors, title, index_col, show_colorbar, bar_width, showgrid_x, showgrid_y, height, width, tasks=None, task_names=None, data=None, group_tasks=False): """ Refer to FigureFactory.create_gantt() for docstring """ if tasks is None: tasks = [] if task_names is None: task_names = [] if data is None: data = [] showlegend = False for index in range(len(chart)): task = dict(x0=chart[index]['Start'], x1=chart[index]['Finish'], name=chart[index]['Task']) if 'Description' in chart[index]: task['description'] = chart[index]['Description'] tasks.append(task) shape_template = { 'type': 'rect', 'xref': 'x', 'yref': 'y', 'opacity': 1, 'line': { 'width': 0, } } index_vals = [] for row in range(len(tasks)): if chart[row][index_col] not in index_vals: index_vals.append(chart[row][index_col]) index_vals.sort() # verify each value in index column appears in colors dictionary for key in index_vals: if key not in colors: raise exceptions.PlotlyError( "If you are using colors as a dictionary, all of its " "keys must be all the values in the index column." ) # create the list of task names for index in range(len(tasks)): tn = tasks[index]['name'] # Is added to task_names if group_tasks is set to False, # or if the option is used (True) it only adds them if the # name is not already in the list if not group_tasks or tn not in task_names: task_names.append(tn) # Guarantees that for grouped tasks the tasks that are inserted first # are shown at the top if group_tasks: task_names.reverse() for index in range(len(tasks)): tn = tasks[index]['name'] del tasks[index]['name'] tasks[index].update(shape_template) # If group_tasks is True, all tasks with the same name belong # to the same row. groupID = index if group_tasks: groupID = task_names.index(tn) tasks[index]['y0'] = groupID - bar_width tasks[index]['y1'] = groupID + bar_width tasks[index]['fillcolor'] = colors[chart[index][index_col]] # add a line for hover text and autorange entry = dict( x=[tasks[index]['x0'], tasks[index]['x1']], y=[groupID, groupID], name='', marker={'color': 'white'} ) if "description" in tasks[index]: entry['text'] = tasks[index]['description'] del tasks[index]['description'] data.append(entry) if show_colorbar is True: # generate dummy data to generate legend showlegend = True for k, index_value in enumerate(index_vals): data.append( dict( x=[tasks[index]['x0'], tasks[index]['x0']], y=[k, k], showlegend=True, hoverinfo='none', name=str(index_value), marker=dict( color=colors[index_value], size=1 ) ) ) layout = dict( title=title, showlegend=showlegend, height=height, width=width, shapes=[], hovermode='closest', yaxis=dict( showgrid=showgrid_y, ticktext=task_names, tickvals=list(range(len(task_names))), range=[-1, len(task_names) + 1], autorange=False, zeroline=False, ), xaxis=dict( showgrid=showgrid_x, zeroline=False, rangeselector=dict( buttons=list([ dict(count=7, label='1w', step='day', stepmode='backward'), dict(count=1, label='1m', step='month', stepmode='backward'), dict(count=6, label='6m', step='month', stepmode='backward'), dict(count=1, label='YTD', step='year', stepmode='todate'), dict(count=1, label='1y', step='year', stepmode='backward'), dict(step='all') ]) ), type='date' ) ) layout['shapes'] = tasks fig = dict(data=data, layout=layout) return fig def create_gantt(df, colors=None, index_col=None, show_colorbar=False, reverse_colors=False, title='Gantt Chart', bar_width=0.2, showgrid_x=False, showgrid_y=False, height=600, width=900, tasks=None, task_names=None, data=None, group_tasks=False): """ Returns figure for a gantt chart :param (array|list) df: input data for gantt chart. Must be either a a dataframe or a list. If dataframe, the columns must include 'Task', 'Start' and 'Finish'. Other columns can be included and used for indexing. If a list, its elements must be dictionaries with the same required column headers: 'Task', 'Start' and 'Finish'. :param (str|list|dict|tuple) colors: either a plotly scale name, an rgb or hex color, a color tuple or a list of colors. An rgb color is of the form 'rgb(x, y, z)' where x, y, z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colors is a list, it must contain the valid color types aforementioned as its members. If a dictionary, all values of the indexing column must be keys in colors. :param (str|float) index_col: the column header (if df is a data frame) that will function as the indexing column. If df is a list, index_col must be one of the keys in all the items of df. :param (bool) show_colorbar: determines if colorbar will be visible. Only applies if values in the index column are numeric. :param (bool) reverse_colors: reverses the order of selected colors :param (str) title: the title of the chart :param (float) bar_width: the width of the horizontal bars in the plot :param (bool) showgrid_x: show/hide the x-axis grid :param (bool) showgrid_y: show/hide the y-axis grid :param (float) height: the height of the chart :param (float) width: the width of the chart Example 1: Simple Gantt Chart ``` import plotly.plotly as py from plotly.figure_factory import create_gantt # Make data for chart df = [dict(Task="Job A", Start='2009-01-01', Finish='2009-02-30'), dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15'), dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30')] # Create a figure fig = create_gantt(df) # Plot the data py.iplot(fig, filename='Simple Gantt Chart', world_readable=True) ``` Example 2: Index by Column with Numerical Entries ``` import plotly.plotly as py from plotly.figure_factory import create_gantt # Make data for chart df = [dict(Task="Job A", Start='2009-01-01', Finish='2009-02-30', Complete=10), dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15', Complete=60), dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30', Complete=95)] # Create a figure with Plotly colorscale fig = create_gantt(df, colors='Blues', index_col='Complete', show_colorbar=True, bar_width=0.5, showgrid_x=True, showgrid_y=True) # Plot the data py.iplot(fig, filename='Numerical Entries', world_readable=True) ``` Example 3: Index by Column with String Entries ``` import plotly.plotly as py from plotly.figure_factory import create_gantt # Make data for chart df = [dict(Task="Job A", Start='2009-01-01', Finish='2009-02-30', Resource='Apple'), dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15', Resource='Grape'), dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30', Resource='Banana')] # Create a figure with Plotly colorscale fig = create_gantt(df, colors=['rgb(200, 50, 25)', (1, 0, 1), '#6c4774'], index_col='Resource', reverse_colors=True, show_colorbar=True) # Plot the data py.iplot(fig, filename='String Entries', world_readable=True) ``` Example 4: Use a dictionary for colors ``` import plotly.plotly as py from plotly.figure_factory import create_gantt # Make data for chart df = [dict(Task="Job A", Start='2009-01-01', Finish='2009-02-30', Resource='Apple'), dict(Task="Job B", Start='2009-03-05', Finish='2009-04-15', Resource='Grape'), dict(Task="Job C", Start='2009-02-20', Finish='2009-05-30', Resource='Banana')] # Make a dictionary of colors colors = {'Apple': 'rgb(255, 0, 0)', 'Grape': 'rgb(170, 14, 200)', 'Banana': (1, 1, 0.2)} # Create a figure with Plotly colorscale fig = create_gantt(df, colors=colors, index_col='Resource', show_colorbar=True) # Plot the data py.iplot(fig, filename='dictioanry colors', world_readable=True) ``` Example 5: Use a pandas dataframe ``` import plotly.plotly as py from plotly.figure_factory import create_gantt import pandas as pd # Make data as a dataframe df = pd.DataFrame([['Run', '2010-01-01', '2011-02-02', 10], ['Fast', '2011-01-01', '2012-06-05', 55], ['Eat', '2012-01-05', '2013-07-05', 94]], columns=['Task', 'Start', 'Finish', 'Complete']) # Create a figure with Plotly colorscale fig = create_gantt(df, colors='Blues', index_col='Complete', show_colorbar=True, bar_width=0.5, showgrid_x=True, showgrid_y=True) # Plot the data py.iplot(fig, filename='data with dataframe', world_readable=True) ``` """ # validate gantt input data chart = validate_gantt(df) if index_col: if index_col not in chart[0]: raise exceptions.PlotlyError( "In order to use an indexing column and assign colors to " "the values of the index, you must choose an actual " "column name in the dataframe or key if a list of " "dictionaries is being used.") # validate gantt index column index_list = [] for dictionary in chart: index_list.append(dictionary[index_col]) utils.validate_index(index_list) # Validate colors if isinstance(colors, dict): colors = utils.validate_colors_dict(colors, 'rgb') else: colors = utils.validate_colors(colors, 'rgb') if reverse_colors is True: colors.reverse() if not index_col: if isinstance(colors, dict): raise exceptions.PlotlyError( "Error. You have set colors to a dictionary but have not " "picked an index. An index is required if you are " "assigning colors to particular values in a dictioanry." ) fig = gantt( chart, colors, title, bar_width, showgrid_x, showgrid_y, height, width, tasks=None, task_names=None, data=None, group_tasks=group_tasks ) return fig else: if not isinstance(colors, dict): fig = gantt_colorscale( chart, colors, title, index_col, show_colorbar, bar_width, showgrid_x, showgrid_y, height, width, tasks=None, task_names=None, data=None, group_tasks=group_tasks ) return fig else: fig = gantt_dict( chart, colors, title, index_col, show_colorbar, bar_width, showgrid_x, showgrid_y, height, width, tasks=None, task_names=None, data=None, group_tasks=group_tasks ) return fig plotly-2.2.3+dfsg.orig/plotly/figure_factory/_dendrogram.py0000644000175000017500000002546313164736572023465 0ustar noahfxnoahfx# -*- coding: utf-8 -*- from __future__ import absolute_import from collections import OrderedDict from plotly import exceptions, optional_imports from plotly.graph_objs import graph_objs # Optional imports, may be None for users that only use our core functionality. np = optional_imports.get_module('numpy') scp = optional_imports.get_module('scipy') sch = optional_imports.get_module('scipy.cluster.hierarchy') scs = optional_imports.get_module('scipy.spatial') def create_dendrogram(X, orientation="bottom", labels=None, colorscale=None, distfun=None, linkagefun=lambda x: sch.linkage(x, 'complete'), hovertext=None): """ BETA function that returns a dendrogram Plotly figure object. :param (ndarray) X: Matrix of observations as array of arrays :param (str) orientation: 'top', 'right', 'bottom', or 'left' :param (list) labels: List of axis category labels(observation labels) :param (list) colorscale: Optional colorscale for dendrogram tree :param (function) distfun: Function to compute the pairwise distance from the observations :param (function) linkagefun: Function to compute the linkage matrix from the pairwise distances :param (list[list]) hovertext: List of hovertext for constituent traces of dendrogram clusters Example 1: Simple bottom oriented dendrogram ``` import plotly.plotly as py from plotly.figure_factory import create_dendrogram import numpy as np X = np.random.rand(10,10) dendro = create_dendrogram(X) plot_url = py.plot(dendro, filename='simple-dendrogram') ``` Example 2: Dendrogram to put on the left of the heatmap ``` import plotly.plotly as py from plotly.figure_factory import create_dendrogram import numpy as np X = np.random.rand(5,5) names = ['Jack', 'Oxana', 'John', 'Chelsea', 'Mark'] dendro = create_dendrogram(X, orientation='right', labels=names) dendro['layout'].update({'width':700, 'height':500}) py.iplot(dendro, filename='vertical-dendrogram') ``` Example 3: Dendrogram with Pandas ``` import plotly.plotly as py from plotly.figure_factory import create_dendrogram import numpy as np import pandas as pd Index= ['A','B','C','D','E','F','G','H','I','J'] df = pd.DataFrame(abs(np.random.randn(10, 10)), index=Index) fig = create_dendrogram(df, labels=Index) url = py.plot(fig, filename='pandas-dendrogram') ``` """ if not scp or not scs or not sch: raise ImportError("FigureFactory.create_dendrogram requires scipy, \ scipy.spatial and scipy.hierarchy") s = X.shape if len(s) != 2: exceptions.PlotlyError("X should be 2-dimensional array.") if distfun is None: distfun = scs.distance.pdist dendrogram = _Dendrogram(X, orientation, labels, colorscale, distfun=distfun, linkagefun=linkagefun, hovertext=hovertext) return graph_objs.Figure(data=dendrogram.data, layout=dendrogram.layout) class _Dendrogram(object): """Refer to FigureFactory.create_dendrogram() for docstring.""" def __init__(self, X, orientation='bottom', labels=None, colorscale=None, width="100%", height="100%", xaxis='xaxis', yaxis='yaxis', distfun=None, linkagefun=lambda x: sch.linkage(x, 'complete'), hovertext=None): self.orientation = orientation self.labels = labels self.xaxis = xaxis self.yaxis = yaxis self.data = [] self.leaves = [] self.sign = {self.xaxis: 1, self.yaxis: 1} self.layout = {self.xaxis: {}, self.yaxis: {}} if self.orientation in ['left', 'bottom']: self.sign[self.xaxis] = 1 else: self.sign[self.xaxis] = -1 if self.orientation in ['right', 'bottom']: self.sign[self.yaxis] = 1 else: self.sign[self.yaxis] = -1 if distfun is None: distfun = scs.distance.pdist (dd_traces, xvals, yvals, ordered_labels, leaves) = self.get_dendrogram_traces(X, colorscale, distfun, linkagefun, hovertext) self.labels = ordered_labels self.leaves = leaves yvals_flat = yvals.flatten() xvals_flat = xvals.flatten() self.zero_vals = [] for i in range(len(yvals_flat)): if yvals_flat[i] == 0.0 and xvals_flat[i] not in self.zero_vals: self.zero_vals.append(xvals_flat[i]) self.zero_vals.sort() self.layout = self.set_figure_layout(width, height) self.data = graph_objs.Data(dd_traces) def get_color_dict(self, colorscale): """ Returns colorscale used for dendrogram tree clusters. :param (list) colorscale: Colors to use for the plot in rgb format. :rtype (dict): A dict of default colors mapped to the user colorscale. """ # These are the color codes returned for dendrograms # We're replacing them with nicer colors d = {'r': 'red', 'g': 'green', 'b': 'blue', 'c': 'cyan', 'm': 'magenta', 'y': 'yellow', 'k': 'black', 'w': 'white'} default_colors = OrderedDict(sorted(d.items(), key=lambda t: t[0])) if colorscale is None: colorscale = [ 'rgb(0,116,217)', # blue 'rgb(35,205,205)', # cyan 'rgb(61,153,112)', # green 'rgb(40,35,35)', # black 'rgb(133,20,75)', # magenta 'rgb(255,65,54)', # red 'rgb(255,255,255)', # white 'rgb(255,220,0)'] # yellow for i in range(len(default_colors.keys())): k = list(default_colors.keys())[i] # PY3 won't index keys if i < len(colorscale): default_colors[k] = colorscale[i] return default_colors def set_axis_layout(self, axis_key): """ Sets and returns default axis object for dendrogram figure. :param (str) axis_key: E.g., 'xaxis', 'xaxis1', 'yaxis', yaxis1', etc. :rtype (dict): An axis_key dictionary with set parameters. """ axis_defaults = { 'type': 'linear', 'ticks': 'outside', 'mirror': 'allticks', 'rangemode': 'tozero', 'showticklabels': True, 'zeroline': False, 'showgrid': False, 'showline': True, } if len(self.labels) != 0: axis_key_labels = self.xaxis if self.orientation in ['left', 'right']: axis_key_labels = self.yaxis if axis_key_labels not in self.layout: self.layout[axis_key_labels] = {} self.layout[axis_key_labels]['tickvals'] = \ [zv*self.sign[axis_key] for zv in self.zero_vals] self.layout[axis_key_labels]['ticktext'] = self.labels self.layout[axis_key_labels]['tickmode'] = 'array' self.layout[axis_key].update(axis_defaults) return self.layout[axis_key] def set_figure_layout(self, width, height): """ Sets and returns default layout object for dendrogram figure. """ self.layout.update({ 'showlegend': False, 'autosize': False, 'hovermode': 'closest', 'width': width, 'height': height }) self.set_axis_layout(self.xaxis) self.set_axis_layout(self.yaxis) return self.layout def get_dendrogram_traces(self, X, colorscale, distfun, linkagefun, hovertext): """ Calculates all the elements needed for plotting a dendrogram. :param (ndarray) X: Matrix of observations as array of arrays :param (list) colorscale: Color scale for dendrogram tree clusters :param (function) distfun: Function to compute the pairwise distance from the observations :param (function) linkagefun: Function to compute the linkage matrix from the pairwise distances :param (list) hovertext: List of hovertext for constituent traces of dendrogram :rtype (tuple): Contains all the traces in the following order: (a) trace_list: List of Plotly trace objects for dendrogram tree (b) icoord: All X points of the dendrogram tree as array of arrays with length 4 (c) dcoord: All Y points of the dendrogram tree as array of arrays with length 4 (d) ordered_labels: leaf labels in the order they are going to appear on the plot (e) P['leaves']: left-to-right traversal of the leaves """ d = distfun(X) Z = linkagefun(d) P = sch.dendrogram(Z, orientation=self.orientation, labels=self.labels, no_plot=True) icoord = scp.array(P['icoord']) dcoord = scp.array(P['dcoord']) ordered_labels = scp.array(P['ivl']) color_list = scp.array(P['color_list']) colors = self.get_color_dict(colorscale) trace_list = [] for i in range(len(icoord)): # xs and ys are arrays of 4 points that make up the '∩' shapes # of the dendrogram tree if self.orientation in ['top', 'bottom']: xs = icoord[i] else: xs = dcoord[i] if self.orientation in ['top', 'bottom']: ys = dcoord[i] else: ys = icoord[i] color_key = color_list[i] hovertext_label = None if hovertext: hovertext_label = hovertext[i] trace = graph_objs.Scatter( x=np.multiply(self.sign[self.xaxis], xs), y=np.multiply(self.sign[self.yaxis], ys), mode='lines', marker=graph_objs.Marker(color=colors[color_key]), text=hovertext_label, hoverinfo='text' ) try: x_index = int(self.xaxis[-1]) except ValueError: x_index = '' try: y_index = int(self.yaxis[-1]) except ValueError: y_index = '' trace['xaxis'] = 'x' + x_index trace['yaxis'] = 'y' + y_index trace_list.append(trace) return trace_list, icoord, dcoord, ordered_labels, P['leaves'] plotly-2.2.3+dfsg.orig/plotly/figure_factory/_quiver.py0000644000175000017500000002011513104403274022623 0ustar noahfxnoahfxfrom __future__ import absolute_import import math from plotly import exceptions from plotly.graph_objs import graph_objs from plotly.figure_factory import utils def create_quiver(x, y, u, v, scale=.1, arrow_scale=.3, angle=math.pi / 9, **kwargs): """ Returns data for a quiver plot. :param (list|ndarray) x: x coordinates of the arrow locations :param (list|ndarray) y: y coordinates of the arrow locations :param (list|ndarray) u: x components of the arrow vectors :param (list|ndarray) v: y components of the arrow vectors :param (float in [0,1]) scale: scales size of the arrows(ideally to avoid overlap). Default = .1 :param (float in [0,1]) arrow_scale: value multiplied to length of barb to get length of arrowhead. Default = .3 :param (angle in radians) angle: angle of arrowhead. Default = pi/9 :param kwargs: kwargs passed through plotly.graph_objs.Scatter for more information on valid kwargs call help(plotly.graph_objs.Scatter) :rtype (dict): returns a representation of quiver figure. Example 1: Trivial Quiver ``` import plotly.plotly as py from plotly.figure_factory import create_quiver import math # 1 Arrow from (0,0) to (1,1) fig = create_quiver(x=[0], y=[0], u=[1], v=[1], scale=1) py.plot(fig, filename='quiver') ``` Example 2: Quiver plot using meshgrid ``` import plotly.plotly as py from plotly.figure_factory import create_quiver import numpy as np import math # Add data x,y = np.meshgrid(np.arange(0, 2, .2), np.arange(0, 2, .2)) u = np.cos(x)*y v = np.sin(x)*y #Create quiver fig = create_quiver(x, y, u, v) # Plot py.plot(fig, filename='quiver') ``` Example 3: Styling the quiver plot ``` import plotly.plotly as py from plotly.figure_factory import create_quiver import numpy as np import math # Add data x, y = np.meshgrid(np.arange(-np.pi, math.pi, .5), np.arange(-math.pi, math.pi, .5)) u = np.cos(x)*y v = np.sin(x)*y # Create quiver fig = create_quiver(x, y, u, v, scale=.2, arrow_scale=.3, angle=math.pi/6, name='Wind Velocity', line=Line(width=1)) # Add title to layout fig['layout'].update(title='Quiver Plot') # Plot py.plot(fig, filename='quiver') ``` """ utils.validate_equal_length(x, y, u, v) utils.validate_positive_scalars(arrow_scale=arrow_scale, scale=scale) barb_x, barb_y = _Quiver(x, y, u, v, scale, arrow_scale, angle).get_barbs() arrow_x, arrow_y = _Quiver(x, y, u, v, scale, arrow_scale, angle).get_quiver_arrows() quiver = graph_objs.Scatter(x=barb_x + arrow_x, y=barb_y + arrow_y, mode='lines', **kwargs) data = [quiver] layout = graph_objs.Layout(hovermode='closest') return graph_objs.Figure(data=data, layout=layout) class _Quiver(object): """ Refer to FigureFactory.create_quiver() for docstring """ def __init__(self, x, y, u, v, scale, arrow_scale, angle, **kwargs): try: x = utils.flatten(x) except exceptions.PlotlyError: pass try: y = utils.flatten(y) except exceptions.PlotlyError: pass try: u = utils.flatten(u) except exceptions.PlotlyError: pass try: v = utils.flatten(v) except exceptions.PlotlyError: pass self.x = x self.y = y self.u = u self.v = v self.scale = scale self.arrow_scale = arrow_scale self.angle = angle self.end_x = [] self.end_y = [] self.scale_uv() barb_x, barb_y = self.get_barbs() arrow_x, arrow_y = self.get_quiver_arrows() def scale_uv(self): """ Scales u and v to avoid overlap of the arrows. u and v are added to x and y to get the endpoints of the arrows so a smaller scale value will result in less overlap of arrows. """ self.u = [i * self.scale for i in self.u] self.v = [i * self.scale for i in self.v] def get_barbs(self): """ Creates x and y startpoint and endpoint pairs After finding the endpoint of each barb this zips startpoint and endpoint pairs to create 2 lists: x_values for barbs and y values for barbs :rtype: (list, list) barb_x, barb_y: list of startpoint and endpoint x_value pairs separated by a None to create the barb of the arrow, and list of startpoint and endpoint y_value pairs separated by a None to create the barb of the arrow. """ self.end_x = [i + j for i, j in zip(self.x, self.u)] self.end_y = [i + j for i, j in zip(self.y, self.v)] empty = [None] * len(self.x) barb_x = utils.flatten(zip(self.x, self.end_x, empty)) barb_y = utils.flatten(zip(self.y, self.end_y, empty)) return barb_x, barb_y def get_quiver_arrows(self): """ Creates lists of x and y values to plot the arrows Gets length of each barb then calculates the length of each side of the arrow. Gets angle of barb and applies angle to each side of the arrowhead. Next uses arrow_scale to scale the length of arrowhead and creates x and y values for arrowhead point1 and point2. Finally x and y values for point1, endpoint and point2s for each arrowhead are separated by a None and zipped to create lists of x and y values for the arrows. :rtype: (list, list) arrow_x, arrow_y: list of point1, endpoint, point2 x_values separated by a None to create the arrowhead and list of point1, endpoint, point2 y_values separated by a None to create the barb of the arrow. """ dif_x = [i - j for i, j in zip(self.end_x, self.x)] dif_y = [i - j for i, j in zip(self.end_y, self.y)] # Get barb lengths(default arrow length = 30% barb length) barb_len = [None] * len(self.x) for index in range(len(barb_len)): barb_len[index] = math.hypot(dif_x[index], dif_y[index]) # Make arrow lengths arrow_len = [None] * len(self.x) arrow_len = [i * self.arrow_scale for i in barb_len] # Get barb angles barb_ang = [None] * len(self.x) for index in range(len(barb_ang)): barb_ang[index] = math.atan2(dif_y[index], dif_x[index]) # Set angles to create arrow ang1 = [i + self.angle for i in barb_ang] ang2 = [i - self.angle for i in barb_ang] cos_ang1 = [None] * len(ang1) for index in range(len(ang1)): cos_ang1[index] = math.cos(ang1[index]) seg1_x = [i * j for i, j in zip(arrow_len, cos_ang1)] sin_ang1 = [None] * len(ang1) for index in range(len(ang1)): sin_ang1[index] = math.sin(ang1[index]) seg1_y = [i * j for i, j in zip(arrow_len, sin_ang1)] cos_ang2 = [None] * len(ang2) for index in range(len(ang2)): cos_ang2[index] = math.cos(ang2[index]) seg2_x = [i * j for i, j in zip(arrow_len, cos_ang2)] sin_ang2 = [None] * len(ang2) for index in range(len(ang2)): sin_ang2[index] = math.sin(ang2[index]) seg2_y = [i * j for i, j in zip(arrow_len, sin_ang2)] # Set coordinates to create arrow for index in range(len(self.end_x)): point1_x = [i - j for i, j in zip(self.end_x, seg1_x)] point1_y = [i - j for i, j in zip(self.end_y, seg1_y)] point2_x = [i - j for i, j in zip(self.end_x, seg2_x)] point2_y = [i - j for i, j in zip(self.end_y, seg2_y)] # Combine lists to create arrow empty = [None] * len(self.end_x) arrow_x = utils.flatten(zip(point1_x, self.end_x, point2_x, empty)) arrow_y = utils.flatten(zip(point1_y, self.end_y, point2_y, empty)) return arrow_x, arrow_y plotly-2.2.3+dfsg.orig/plotly/figure_factory/_annotated_heatmap.py0000644000175000017500000002267313104403274024777 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly import exceptions, optional_imports from plotly.figure_factory import utils from plotly.graph_objs import graph_objs # Optional imports, may be None for users that only use our core functionality. np = optional_imports.get_module('numpy') def validate_annotated_heatmap(z, x, y, annotation_text): """ Annotated-heatmap-specific validations Check that if a text matrix is supplied, it has the same dimensions as the z matrix. See FigureFactory.create_annotated_heatmap() for params :raises: (PlotlyError) If z and text matrices do not have the same dimensions. """ if annotation_text is not None and isinstance(annotation_text, list): utils.validate_equal_length(z, annotation_text) for lst in range(len(z)): if len(z[lst]) != len(annotation_text[lst]): raise exceptions.PlotlyError("z and text should have the " "same dimensions") if x: if len(x) != len(z[0]): raise exceptions.PlotlyError("oops, the x list that you " "provided does not match the " "width of your z matrix ") if y: if len(y) != len(z): raise exceptions.PlotlyError("oops, the y list that you " "provided does not match the " "length of your z matrix ") def create_annotated_heatmap(z, x=None, y=None, annotation_text=None, colorscale='RdBu', font_colors=None, showscale=False, reversescale=False, **kwargs): """ BETA function that creates annotated heatmaps This function adds annotations to each cell of the heatmap. :param (list[list]|ndarray) z: z matrix to create heatmap. :param (list) x: x axis labels. :param (list) y: y axis labels. :param (list[list]|ndarray) annotation_text: Text strings for annotations. Should have the same dimensions as the z matrix. If no text is added, the values of the z matrix are annotated. Default = z matrix values. :param (list|str) colorscale: heatmap colorscale. :param (list) font_colors: List of two color strings: [min_text_color, max_text_color] where min_text_color is applied to annotations for heatmap values < (max_value - min_value)/2. If font_colors is not defined, the colors are defined logically as black or white depending on the heatmap's colorscale. :param (bool) showscale: Display colorscale. Default = False :param kwargs: kwargs passed through plotly.graph_objs.Heatmap. These kwargs describe other attributes about the annotated Heatmap trace such as the colorscale. For more information on valid kwargs call help(plotly.graph_objs.Heatmap) Example 1: Simple annotated heatmap with default configuration ``` import plotly.plotly as py import plotly.figure_factory as FF z = [[0.300000, 0.00000, 0.65, 0.300000], [1, 0.100005, 0.45, 0.4300], [0.300000, 0.00000, 0.65, 0.300000], [1, 0.100005, 0.45, 0.00000]] figure = FF.create_annotated_heatmap(z) py.iplot(figure) ``` """ # Avoiding mutables in the call signature font_colors = font_colors if font_colors is not None else [] validate_annotated_heatmap(z, x, y, annotation_text) annotations = _AnnotatedHeatmap(z, x, y, annotation_text, colorscale, font_colors, reversescale, **kwargs).make_annotations() if x or y: trace = dict(type='heatmap', z=z, x=x, y=y, colorscale=colorscale, showscale=showscale, **kwargs) layout = dict(annotations=annotations, xaxis=dict(ticks='', dtick=1, side='top', gridcolor='rgb(0, 0, 0)'), yaxis=dict(ticks='', dtick=1, ticksuffix=' ')) else: trace = dict(type='heatmap', z=z, colorscale=colorscale, showscale=showscale, **kwargs) layout = dict(annotations=annotations, xaxis=dict(ticks='', side='top', gridcolor='rgb(0, 0, 0)', showticklabels=False), yaxis=dict(ticks='', ticksuffix=' ', showticklabels=False)) data = [trace] return graph_objs.Figure(data=data, layout=layout) class _AnnotatedHeatmap(object): """ Refer to TraceFactory.create_annotated_heatmap() for docstring """ def __init__(self, z, x, y, annotation_text, colorscale, font_colors, reversescale, **kwargs): self.z = z if x: self.x = x else: self.x = range(len(z[0])) if y: self.y = y else: self.y = range(len(z)) if annotation_text is not None: self.annotation_text = annotation_text else: self.annotation_text = self.z self.colorscale = colorscale self.reversescale = reversescale self.font_colors = font_colors def get_text_color(self): """ Get font color for annotations. The annotated heatmap can feature two text colors: min_text_color and max_text_color. The min_text_color is applied to annotations for heatmap values < (max_value - min_value)/2. The user can define these two colors. Otherwise the colors are defined logically as black or white depending on the heatmap's colorscale. :rtype (string, string) min_text_color, max_text_color: text color for annotations for heatmap values < (max_value - min_value)/2 and text color for annotations for heatmap values >= (max_value - min_value)/2 """ # Plotly colorscales ranging from a lighter shade to a darker shade colorscales = ['Greys', 'Greens', 'Blues', 'YIGnBu', 'YIOrRd', 'RdBu', 'Picnic', 'Jet', 'Hot', 'Blackbody', 'Earth', 'Electric', 'Viridis'] # Plotly colorscales ranging from a darker shade to a lighter shade colorscales_reverse = ['Reds'] if self.font_colors: min_text_color = self.font_colors[0] max_text_color = self.font_colors[-1] elif self.colorscale in colorscales and self.reversescale: min_text_color = '#000000' max_text_color = '#FFFFFF' elif self.colorscale in colorscales: min_text_color = '#FFFFFF' max_text_color = '#000000' elif self.colorscale in colorscales_reverse and self.reversescale: min_text_color = '#FFFFFF' max_text_color = '#000000' elif self.colorscale in colorscales_reverse: min_text_color = '#000000' max_text_color = '#FFFFFF' elif isinstance(self.colorscale, list): if 'rgb' in self.colorscale[0][1]: min_col = map(int, self.colorscale[0][1].strip('rgb()').split(',')) max_col = map(int, self.colorscale[-1][1].strip('rgb()').split(',')) elif '#' in self.colorscale[0][1]: min_col = utils.hex_to_rgb(self.colorscale[0][1]) max_col = utils.hex_to_rgb(self.colorscale[-1][1]) else: min_col = [255, 255, 255] max_col = [255, 255, 255] if (min_col[0]*0.299 + min_col[1]*0.587 + min_col[2]*0.114) > 186: min_text_color = '#000000' else: min_text_color = '#FFFFFF' if (max_col[0]*0.299 + max_col[1]*0.587 + max_col[2]*0.114) > 186: max_text_color = '#000000' else: max_text_color = '#FFFFFF' else: min_text_color = '#000000' max_text_color = '#000000' return min_text_color, max_text_color def get_z_mid(self): """ Get the mid value of z matrix :rtype (float) z_avg: average val from z matrix """ if np and isinstance(self.z, np.ndarray): z_min = np.amin(self.z) z_max = np.amax(self.z) else: z_min = min(min(self.z)) z_max = max(max(self.z)) z_mid = (z_max+z_min) / 2 return z_mid def make_annotations(self): """ Get annotations for each cell of the heatmap with graph_objs.Annotation :rtype (list[dict]) annotations: list of annotations for each cell of the heatmap """ min_text_color, max_text_color = _AnnotatedHeatmap.get_text_color(self) z_mid = _AnnotatedHeatmap.get_z_mid(self) annotations = [] for n, row in enumerate(self.z): for m, val in enumerate(row): font_color = min_text_color if val < z_mid else max_text_color annotations.append( graph_objs.Annotation( text=str(self.annotation_text[n][m]), x=self.x[m], y=self.y[n], xref='x1', yref='y1', font=dict(color=font_color), showarrow=False)) return annotations plotly-2.2.3+dfsg.orig/plotly/figure_factory/_trisurf.py0000644000175000017500000004147413104403274023021 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly import colors, exceptions, optional_imports from plotly.graph_objs import graph_objs np = optional_imports.get_module('numpy') def map_face2color(face, colormap, scale, vmin, vmax): """ Normalize facecolor values by vmin/vmax and return rgb-color strings This function takes a tuple color along with a colormap and a minimum (vmin) and maximum (vmax) range of possible mean distances for the given parametrized surface. It returns an rgb color based on the mean distance between vmin and vmax """ if vmin >= vmax: raise exceptions.PlotlyError("Incorrect relation between vmin " "and vmax. The vmin value cannot be " "bigger than or equal to the value " "of vmax.") if len(colormap) == 1: # color each triangle face with the same color in colormap face_color = colormap[0] face_color = colors.convert_to_RGB_255(face_color) face_color = colors.label_rgb(face_color) return face_color if face == vmax: # pick last color in colormap face_color = colormap[-1] face_color = colors.convert_to_RGB_255(face_color) face_color = colors.label_rgb(face_color) return face_color else: if scale is None: # find the normalized distance t of a triangle face between # vmin and vmax where the distance is between 0 and 1 t = (face - vmin) / float((vmax - vmin)) low_color_index = int(t / (1./(len(colormap) - 1))) face_color = colors.find_intermediate_color( colormap[low_color_index], colormap[low_color_index + 1], t * (len(colormap) - 1) - low_color_index ) face_color = colors.convert_to_RGB_255(face_color) face_color = colors.label_rgb(face_color) else: # find the face color for a non-linearly interpolated scale t = (face - vmin) / float((vmax - vmin)) low_color_index = 0 for k in range(len(scale) - 1): if scale[k] <= t < scale[k+1]: break low_color_index += 1 low_scale_val = scale[low_color_index] high_scale_val = scale[low_color_index + 1] face_color = colors.find_intermediate_color( colormap[low_color_index], colormap[low_color_index + 1], (t - low_scale_val)/(high_scale_val - low_scale_val) ) face_color = colors.convert_to_RGB_255(face_color) face_color = colors.label_rgb(face_color) return face_color def trisurf(x, y, z, simplices, show_colorbar, edges_color, scale, colormap=None, color_func=None, plot_edges=False, x_edge=None, y_edge=None, z_edge=None, facecolor=None): """ Refer to FigureFactory.create_trisurf() for docstring """ # numpy import check if not np: raise ImportError("FigureFactory._trisurf() requires " "numpy imported.") points3D = np.vstack((x, y, z)).T simplices = np.atleast_2d(simplices) # vertices of the surface triangles tri_vertices = points3D[simplices] # Define colors for the triangle faces if color_func is None: # mean values of z-coordinates of triangle vertices mean_dists = tri_vertices[:, :, 2].mean(-1) elif isinstance(color_func, (list, np.ndarray)): # Pre-computed list / array of values to map onto color if len(color_func) != len(simplices): raise ValueError("If color_func is a list/array, it must " "be the same length as simplices.") # convert all colors in color_func to rgb for index in range(len(color_func)): if isinstance(color_func[index], str): if '#' in color_func[index]: foo = colors.hex_to_rgb(color_func[index]) color_func[index] = colors.label_rgb(foo) if isinstance(color_func[index], tuple): foo = colors.convert_to_RGB_255(color_func[index]) color_func[index] = colors.label_rgb(foo) mean_dists = np.asarray(color_func) else: # apply user inputted function to calculate # custom coloring for triangle vertices mean_dists = [] for triangle in tri_vertices: dists = [] for vertex in triangle: dist = color_func(vertex[0], vertex[1], vertex[2]) dists.append(dist) mean_dists.append(np.mean(dists)) mean_dists = np.asarray(mean_dists) # Check if facecolors are already strings and can be skipped if isinstance(mean_dists[0], str): facecolor = mean_dists else: min_mean_dists = np.min(mean_dists) max_mean_dists = np.max(mean_dists) if facecolor is None: facecolor = [] for index in range(len(mean_dists)): color = map_face2color(mean_dists[index], colormap, scale, min_mean_dists, max_mean_dists) facecolor.append(color) # Make sure facecolor is a list so output is consistent across Pythons facecolor = np.asarray(facecolor) ii, jj, kk = simplices.T triangles = graph_objs.Mesh3d(x=x, y=y, z=z, facecolor=facecolor, i=ii, j=jj, k=kk, name='') mean_dists_are_numbers = not isinstance(mean_dists[0], str) if mean_dists_are_numbers and show_colorbar is True: # make a colorscale from the colors colorscale = colors.make_colorscale(colormap, scale) colorscale = colors.convert_colorscale_to_rgb(colorscale) colorbar = graph_objs.Scatter3d( x=x[:1], y=y[:1], z=z[:1], mode='markers', marker=dict( size=0.1, color=[min_mean_dists, max_mean_dists], colorscale=colorscale, showscale=True), hoverinfo='None', showlegend=False ) # the triangle sides are not plotted if plot_edges is False: if mean_dists_are_numbers and show_colorbar is True: return graph_objs.Data([triangles, colorbar]) else: return graph_objs.Data([triangles]) # define the lists x_edge, y_edge and z_edge, of x, y, resp z # coordinates of edge end points for each triangle # None separates data corresponding to two consecutive triangles is_none = [ii is None for ii in [x_edge, y_edge, z_edge]] if any(is_none): if not all(is_none): raise ValueError("If any (x_edge, y_edge, z_edge) is None, " "all must be None") else: x_edge = [] y_edge = [] z_edge = [] # Pull indices we care about, then add a None column to separate tris ixs_triangles = [0, 1, 2, 0] pull_edges = tri_vertices[:, ixs_triangles, :] x_edge_pull = np.hstack([pull_edges[:, :, 0], np.tile(None, [pull_edges.shape[0], 1])]) y_edge_pull = np.hstack([pull_edges[:, :, 1], np.tile(None, [pull_edges.shape[0], 1])]) z_edge_pull = np.hstack([pull_edges[:, :, 2], np.tile(None, [pull_edges.shape[0], 1])]) # Now unravel the edges into a 1-d vector for plotting x_edge = np.hstack([x_edge, x_edge_pull.reshape([1, -1])[0]]) y_edge = np.hstack([y_edge, y_edge_pull.reshape([1, -1])[0]]) z_edge = np.hstack([z_edge, z_edge_pull.reshape([1, -1])[0]]) if not (len(x_edge) == len(y_edge) == len(z_edge)): raise exceptions.PlotlyError("The lengths of x_edge, y_edge and " "z_edge are not the same.") # define the lines for plotting lines = graph_objs.Scatter3d( x=x_edge, y=y_edge, z=z_edge, mode='lines', line=graph_objs.Line( color=edges_color, width=1.5 ), showlegend=False ) if mean_dists_are_numbers and show_colorbar is True: return graph_objs.Data([triangles, lines, colorbar]) else: return graph_objs.Data([triangles, lines]) def create_trisurf(x, y, z, simplices, colormap=None, show_colorbar=True, scale=None, color_func=None, title='Trisurf Plot', plot_edges=True, showbackground=True, backgroundcolor='rgb(230, 230, 230)', gridcolor='rgb(255, 255, 255)', zerolinecolor='rgb(255, 255, 255)', edges_color='rgb(50, 50, 50)', height=800, width=800, aspectratio=None): """ Returns figure for a triangulated surface plot :param (array) x: data values of x in a 1D array :param (array) y: data values of y in a 1D array :param (array) z: data values of z in a 1D array :param (array) simplices: an array of shape (ntri, 3) where ntri is the number of triangles in the triangularization. Each row of the array contains the indicies of the verticies of each triangle :param (str|tuple|list) colormap: either a plotly scale name, an rgb or hex color, a color tuple or a list of colors. An rgb color is of the form 'rgb(x, y, z)' where x, y, z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colormap is a list, it must contain the valid color types aforementioned as its members :param (bool) show_colorbar: determines if colorbar is visible :param (list|array) scale: sets the scale values to be used if a non- linearly interpolated colormap is desired. If left as None, a linear interpolation between the colors will be excecuted :param (function|list) color_func: The parameter that determines the coloring of the surface. Takes either a function with 3 arguments x, y, z or a list/array of color values the same length as simplices. If None, coloring will only depend on the z axis :param (str) title: title of the plot :param (bool) plot_edges: determines if the triangles on the trisurf are visible :param (bool) showbackground: makes background in plot visible :param (str) backgroundcolor: color of background. Takes a string of the form 'rgb(x,y,z)' x,y,z are between 0 and 255 inclusive :param (str) gridcolor: color of the gridlines besides the axes. Takes a string of the form 'rgb(x,y,z)' x,y,z are between 0 and 255 inclusive :param (str) zerolinecolor: color of the axes. Takes a string of the form 'rgb(x,y,z)' x,y,z are between 0 and 255 inclusive :param (str) edges_color: color of the edges, if plot_edges is True :param (int|float) height: the height of the plot (in pixels) :param (int|float) width: the width of the plot (in pixels) :param (dict) aspectratio: a dictionary of the aspect ratio values for the x, y and z axes. 'x', 'y' and 'z' take (int|float) values Example 1: Sphere ``` # Necessary Imports for Trisurf import numpy as np from scipy.spatial import Delaunay import plotly.plotly as py from plotly.figure_factory import create_trisurf from plotly.graph_objs import graph_objs # Make data for plot u = np.linspace(0, 2*np.pi, 20) v = np.linspace(0, np.pi, 20) u,v = np.meshgrid(u,v) u = u.flatten() v = v.flatten() x = np.sin(v)*np.cos(u) y = np.sin(v)*np.sin(u) z = np.cos(v) points2D = np.vstack([u,v]).T tri = Delaunay(points2D) simplices = tri.simplices # Create a figure fig1 = create_trisurf(x=x, y=y, z=z, colormap="Rainbow", simplices=simplices) # Plot the data py.iplot(fig1, filename='trisurf-plot-sphere') ``` Example 2: Torus ``` # Necessary Imports for Trisurf import numpy as np from scipy.spatial import Delaunay import plotly.plotly as py from plotly.figure_factory import create_trisurf from plotly.graph_objs import graph_objs # Make data for plot u = np.linspace(0, 2*np.pi, 20) v = np.linspace(0, 2*np.pi, 20) u,v = np.meshgrid(u,v) u = u.flatten() v = v.flatten() x = (3 + (np.cos(v)))*np.cos(u) y = (3 + (np.cos(v)))*np.sin(u) z = np.sin(v) points2D = np.vstack([u,v]).T tri = Delaunay(points2D) simplices = tri.simplices # Create a figure fig1 = create_trisurf(x=x, y=y, z=z, colormap="Viridis", simplices=simplices) # Plot the data py.iplot(fig1, filename='trisurf-plot-torus') ``` Example 3: Mobius Band ``` # Necessary Imports for Trisurf import numpy as np from scipy.spatial import Delaunay import plotly.plotly as py from plotly.figure_factory import create_trisurf from plotly.graph_objs import graph_objs # Make data for plot u = np.linspace(0, 2*np.pi, 24) v = np.linspace(-1, 1, 8) u,v = np.meshgrid(u,v) u = u.flatten() v = v.flatten() tp = 1 + 0.5*v*np.cos(u/2.) x = tp*np.cos(u) y = tp*np.sin(u) z = 0.5*v*np.sin(u/2.) points2D = np.vstack([u,v]).T tri = Delaunay(points2D) simplices = tri.simplices # Create a figure fig1 = create_trisurf(x=x, y=y, z=z, colormap=[(0.2, 0.4, 0.6), (1, 1, 1)], simplices=simplices) # Plot the data py.iplot(fig1, filename='trisurf-plot-mobius-band') ``` Example 4: Using a Custom Colormap Function with Light Cone ``` # Necessary Imports for Trisurf import numpy as np from scipy.spatial import Delaunay import plotly.plotly as py from plotly.figure_factory import create_trisurf from plotly.graph_objs import graph_objs # Make data for plot u=np.linspace(-np.pi, np.pi, 30) v=np.linspace(-np.pi, np.pi, 30) u,v=np.meshgrid(u,v) u=u.flatten() v=v.flatten() x = u y = u*np.cos(v) z = u*np.sin(v) points2D = np.vstack([u,v]).T tri = Delaunay(points2D) simplices = tri.simplices # Define distance function def dist_origin(x, y, z): return np.sqrt((1.0 * x)**2 + (1.0 * y)**2 + (1.0 * z)**2) # Create a figure fig1 = create_trisurf(x=x, y=y, z=z, colormap=['#FFFFFF', '#E4FFFE', '#A4F6F9', '#FF99FE', '#BA52ED'], scale=[0, 0.6, 0.71, 0.89, 1], simplices=simplices, color_func=dist_origin) # Plot the data py.iplot(fig1, filename='trisurf-plot-custom-coloring') ``` Example 5: Enter color_func as a list of colors ``` # Necessary Imports for Trisurf import numpy as np from scipy.spatial import Delaunay import random import plotly.plotly as py from plotly.figure_factory import create_trisurf from plotly.graph_objs import graph_objs # Make data for plot u=np.linspace(-np.pi, np.pi, 30) v=np.linspace(-np.pi, np.pi, 30) u,v=np.meshgrid(u,v) u=u.flatten() v=v.flatten() x = u y = u*np.cos(v) z = u*np.sin(v) points2D = np.vstack([u,v]).T tri = Delaunay(points2D) simplices = tri.simplices colors = [] color_choices = ['rgb(0, 0, 0)', '#6c4774', '#d6c7dd'] for index in range(len(simplices)): colors.append(random.choice(color_choices)) fig = create_trisurf( x, y, z, simplices, color_func=colors, show_colorbar=True, edges_color='rgb(2, 85, 180)', title=' Modern Art' ) py.iplot(fig, filename="trisurf-plot-modern-art") ``` """ if aspectratio is None: aspectratio = {'x': 1, 'y': 1, 'z': 1} # Validate colormap colors.validate_colors(colormap) colormap, scale = colors.convert_colors_to_same_type( colormap, colortype='tuple', return_default_colors=True, scale=scale ) data1 = trisurf(x, y, z, simplices, show_colorbar=show_colorbar, color_func=color_func, colormap=colormap, scale=scale, edges_color=edges_color, plot_edges=plot_edges) axis = dict( showbackground=showbackground, backgroundcolor=backgroundcolor, gridcolor=gridcolor, zerolinecolor=zerolinecolor, ) layout = graph_objs.Layout( title=title, width=width, height=height, scene=graph_objs.Scene( xaxis=graph_objs.XAxis(axis), yaxis=graph_objs.YAxis(axis), zaxis=graph_objs.ZAxis(axis), aspectratio=dict( x=aspectratio['x'], y=aspectratio['y'], z=aspectratio['z']), ) ) return graph_objs.Figure(data=data1, layout=layout) plotly-2.2.3+dfsg.orig/plotly/figure_factory/_violin.py0000644000175000017500000005107213142055566022627 0ustar noahfxnoahfxfrom __future__ import absolute_import from numbers import Number from plotly import exceptions, optional_imports from plotly.figure_factory import utils from plotly.graph_objs import graph_objs from plotly.tools import make_subplots pd = optional_imports.get_module('pandas') np = optional_imports.get_module('numpy') scipy_stats = optional_imports.get_module('scipy.stats') def calc_stats(data): """ Calculate statistics for use in violin plot. """ x = np.asarray(data, np.float) vals_min = np.min(x) vals_max = np.max(x) q2 = np.percentile(x, 50, interpolation='linear') q1 = np.percentile(x, 25, interpolation='lower') q3 = np.percentile(x, 75, interpolation='higher') iqr = q3 - q1 whisker_dist = 1.5 * iqr # in order to prevent drawing whiskers outside the interval # of data one defines the whisker positions as: d1 = np.min(x[x >= (q1 - whisker_dist)]) d2 = np.max(x[x <= (q3 + whisker_dist)]) return { 'min': vals_min, 'max': vals_max, 'q1': q1, 'q2': q2, 'q3': q3, 'd1': d1, 'd2': d2 } def make_half_violin(x, y, fillcolor='#1f77b4', linecolor='rgb(0, 0, 0)'): """ Produces a sideways probability distribution fig violin plot. """ text = ['(pdf(y), y)=(' + '{:0.2f}'.format(x[i]) + ', ' + '{:0.2f}'.format(y[i]) + ')' for i in range(len(x))] return graph_objs.Scatter( x=x, y=y, mode='lines', name='', text=text, fill='tonextx', fillcolor=fillcolor, line=graph_objs.Line(width=0.5, color=linecolor, shape='spline'), hoverinfo='text', opacity=0.5 ) def make_violin_rugplot(vals, pdf_max, distance, color='#1f77b4'): """ Returns a rugplot fig for a violin plot. """ return graph_objs.Scatter( y=vals, x=[-pdf_max-distance]*len(vals), marker=graph_objs.Marker( color=color, symbol='line-ew-open' ), mode='markers', name='', showlegend=False, hoverinfo='y' ) def make_non_outlier_interval(d1, d2): """ Returns the scatterplot fig of most of a violin plot. """ return graph_objs.Scatter( x=[0, 0], y=[d1, d2], name='', mode='lines', line=graph_objs.Line(width=1.5, color='rgb(0,0,0)') ) def make_quartiles(q1, q3): """ Makes the upper and lower quartiles for a violin plot. """ return graph_objs.Scatter( x=[0, 0], y=[q1, q3], text=['lower-quartile: ' + '{:0.2f}'.format(q1), 'upper-quartile: ' + '{:0.2f}'.format(q3)], mode='lines', line=graph_objs.Line( width=4, color='rgb(0,0,0)' ), hoverinfo='text' ) def make_median(q2): """ Formats the 'median' hovertext for a violin plot. """ return graph_objs.Scatter( x=[0], y=[q2], text=['median: ' + '{:0.2f}'.format(q2)], mode='markers', marker=dict(symbol='square', color='rgb(255,255,255)'), hoverinfo='text' ) def make_XAxis(xaxis_title, xaxis_range): """ Makes the x-axis for a violin plot. """ xaxis = graph_objs.XAxis(title=xaxis_title, range=xaxis_range, showgrid=False, zeroline=False, showline=False, mirror=False, ticks='', showticklabels=False) return xaxis def make_YAxis(yaxis_title): """ Makes the y-axis for a violin plot. """ yaxis = graph_objs.YAxis(title=yaxis_title, showticklabels=True, autorange=True, ticklen=4, showline=True, zeroline=False, showgrid=False, mirror=False) return yaxis def violinplot(vals, fillcolor='#1f77b4', rugplot=True): """ Refer to FigureFactory.create_violin() for docstring. """ vals = np.asarray(vals, np.float) # summary statistics vals_min = calc_stats(vals)['min'] vals_max = calc_stats(vals)['max'] q1 = calc_stats(vals)['q1'] q2 = calc_stats(vals)['q2'] q3 = calc_stats(vals)['q3'] d1 = calc_stats(vals)['d1'] d2 = calc_stats(vals)['d2'] # kernel density estimation of pdf pdf = scipy_stats.gaussian_kde(vals) # grid over the data interval xx = np.linspace(vals_min, vals_max, 100) # evaluate the pdf at the grid xx yy = pdf(xx) max_pdf = np.max(yy) # distance from the violin plot to rugplot distance = (2.0 * max_pdf)/10 if rugplot else 0 # range for x values in the plot plot_xrange = [-max_pdf - distance - 0.1, max_pdf + 0.1] plot_data = [make_half_violin(-yy, xx, fillcolor=fillcolor), make_half_violin(yy, xx, fillcolor=fillcolor), make_non_outlier_interval(d1, d2), make_quartiles(q1, q3), make_median(q2)] if rugplot: plot_data.append(make_violin_rugplot(vals, max_pdf, distance=distance, color=fillcolor)) return plot_data, plot_xrange def violin_no_colorscale(data, data_header, group_header, colors, use_colorscale, group_stats, rugplot, sort, height, width, title): """ Refer to FigureFactory.create_violin() for docstring. Returns fig for violin plot without colorscale. """ # collect all group names group_name = [] for name in data[group_header]: if name not in group_name: group_name.append(name) if sort: group_name.sort() gb = data.groupby([group_header]) L = len(group_name) fig = make_subplots(rows=1, cols=L, shared_yaxes=True, horizontal_spacing=0.025, print_grid=False) color_index = 0 for k, gr in enumerate(group_name): vals = np.asarray(gb.get_group(gr)[data_header], np.float) if color_index >= len(colors): color_index = 0 plot_data, plot_xrange = violinplot(vals, fillcolor=colors[color_index], rugplot=rugplot) layout = graph_objs.Layout() for item in plot_data: fig.append_trace(item, 1, k + 1) color_index += 1 # add violin plot labels fig['layout'].update( {'xaxis{}'.format(k + 1): make_XAxis(group_name[k], plot_xrange)} ) # set the sharey axis style fig['layout'].update({'yaxis{}'.format(1): make_YAxis('')}) fig['layout'].update( title=title, showlegend=False, hovermode='closest', autosize=False, height=height, width=width ) return fig def violin_colorscale(data, data_header, group_header, colors, use_colorscale, group_stats, rugplot, sort, height, width, title): """ Refer to FigureFactory.create_violin() for docstring. Returns fig for violin plot with colorscale. """ # collect all group names group_name = [] for name in data[group_header]: if name not in group_name: group_name.append(name) if sort: group_name.sort() # make sure all group names are keys in group_stats for group in group_name: if group not in group_stats: raise exceptions.PlotlyError("All values/groups in the index " "column must be represented " "as a key in group_stats.") gb = data.groupby([group_header]) L = len(group_name) fig = make_subplots(rows=1, cols=L, shared_yaxes=True, horizontal_spacing=0.025, print_grid=False) # prepare low and high color for colorscale lowcolor = utils.color_parser(colors[0], utils.unlabel_rgb) highcolor = utils.color_parser(colors[1], utils.unlabel_rgb) # find min and max values in group_stats group_stats_values = [] for key in group_stats: group_stats_values.append(group_stats[key]) max_value = max(group_stats_values) min_value = min(group_stats_values) for k, gr in enumerate(group_name): vals = np.asarray(gb.get_group(gr)[data_header], np.float) # find intermediate color from colorscale intermed = (group_stats[gr] - min_value) / (max_value - min_value) intermed_color = utils.find_intermediate_color( lowcolor, highcolor, intermed ) plot_data, plot_xrange = violinplot( vals, fillcolor='rgb{}'.format(intermed_color), rugplot=rugplot ) layout = graph_objs.Layout() for item in plot_data: fig.append_trace(item, 1, k + 1) fig['layout'].update( {'xaxis{}'.format(k + 1): make_XAxis(group_name[k], plot_xrange)} ) # add colorbar to plot trace_dummy = graph_objs.Scatter( x=[0], y=[0], mode='markers', marker=dict( size=2, cmin=min_value, cmax=max_value, colorscale=[[0, colors[0]], [1, colors[1]]], showscale=True), showlegend=False, ) fig.append_trace(trace_dummy, 1, L) # set the sharey axis style fig['layout'].update({'yaxis{}'.format(1): make_YAxis('')}) fig['layout'].update( title=title, showlegend=False, hovermode='closest', autosize=False, height=height, width=width ) return fig def violin_dict(data, data_header, group_header, colors, use_colorscale, group_stats, rugplot, sort, height, width, title): """ Refer to FigureFactory.create_violin() for docstring. Returns fig for violin plot without colorscale. """ # collect all group names group_name = [] for name in data[group_header]: if name not in group_name: group_name.append(name) if sort: group_name.sort() # check if all group names appear in colors dict for group in group_name: if group not in colors: raise exceptions.PlotlyError("If colors is a dictionary, all " "the group names must appear as " "keys in colors.") gb = data.groupby([group_header]) L = len(group_name) fig = make_subplots(rows=1, cols=L, shared_yaxes=True, horizontal_spacing=0.025, print_grid=False) for k, gr in enumerate(group_name): vals = np.asarray(gb.get_group(gr)[data_header], np.float) plot_data, plot_xrange = violinplot(vals, fillcolor=colors[gr], rugplot=rugplot) layout = graph_objs.Layout() for item in plot_data: fig.append_trace(item, 1, k + 1) # add violin plot labels fig['layout'].update( {'xaxis{}'.format(k + 1): make_XAxis(group_name[k], plot_xrange)} ) # set the sharey axis style fig['layout'].update({'yaxis{}'.format(1): make_YAxis('')}) fig['layout'].update( title=title, showlegend=False, hovermode='closest', autosize=False, height=height, width=width ) return fig def create_violin(data, data_header=None, group_header=None, colors=None, use_colorscale=False, group_stats=None, rugplot=True, sort=False, height=450, width=600, title='Violin and Rug Plot'): """ Returns figure for a violin plot :param (list|array) data: accepts either a list of numerical values, a list of dictionaries all with identical keys and at least one column of numeric values, or a pandas dataframe with at least one column of numbers. :param (str) data_header: the header of the data column to be used from an inputted pandas dataframe. Not applicable if 'data' is a list of numeric values. :param (str) group_header: applicable if grouping data by a variable. 'group_header' must be set to the name of the grouping variable. :param (str|tuple|list|dict) colors: either a plotly scale name, an rgb or hex color, a color tuple, a list of colors or a dictionary. An rgb color is of the form 'rgb(x, y, z)' where x, y and z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colors is a list, it must contain valid color types as its members. :param (bool) use_colorscale: only applicable if grouping by another variable. Will implement a colorscale based on the first 2 colors of param colors. This means colors must be a list with at least 2 colors in it (Plotly colorscales are accepted since they map to a list of two rgb colors). Default = False :param (dict) group_stats: a dictioanry where each key is a unique value from the group_header column in data. Each value must be a number and will be used to color the violin plots if a colorscale is being used. :param (bool) rugplot: determines if a rugplot is draw on violin plot. Default = True :param (bool) sort: determines if violins are sorted alphabetically (True) or by input order (False). Default = False :param (float) height: the height of the violin plot. :param (float) width: the width of the violin plot. :param (str) title: the title of the violin plot. Example 1: Single Violin Plot ``` import plotly.plotly as py from plotly.figure_factory import create_violin from plotly.graph_objs import graph_objs import numpy as np from scipy import stats # create list of random values data_list = np.random.randn(100) data_list.tolist() # create violin fig fig = create_violin(data_list, colors='#604d9e') # plot py.iplot(fig, filename='Violin Plot') ``` Example 2: Multiple Violin Plots with Qualitative Coloring ``` import plotly.plotly as py from plotly.figure_factory import create_violin from plotly.graph_objs import graph_objs import numpy as np import pandas as pd from scipy import stats # create dataframe np.random.seed(619517) Nr=250 y = np.random.randn(Nr) gr = np.random.choice(list("ABCDE"), Nr) norm_params=[(0, 1.2), (0.7, 1), (-0.5, 1.4), (0.3, 1), (0.8, 0.9)] for i, letter in enumerate("ABCDE"): y[gr == letter] *=norm_params[i][1]+ norm_params[i][0] df = pd.DataFrame(dict(Score=y, Group=gr)) # create violin fig fig = create_violin(df, data_header='Score', group_header='Group', sort=True, height=600, width=1000) # plot py.iplot(fig, filename='Violin Plot with Coloring') ``` Example 3: Violin Plots with Colorscale ``` import plotly.plotly as py from plotly.figure_factory import create_violin from plotly.graph_objs import graph_objs import numpy as np import pandas as pd from scipy import stats # create dataframe np.random.seed(619517) Nr=250 y = np.random.randn(Nr) gr = np.random.choice(list("ABCDE"), Nr) norm_params=[(0, 1.2), (0.7, 1), (-0.5, 1.4), (0.3, 1), (0.8, 0.9)] for i, letter in enumerate("ABCDE"): y[gr == letter] *=norm_params[i][1]+ norm_params[i][0] df = pd.DataFrame(dict(Score=y, Group=gr)) # define header params data_header = 'Score' group_header = 'Group' # make groupby object with pandas group_stats = {} groupby_data = df.groupby([group_header]) for group in "ABCDE": data_from_group = groupby_data.get_group(group)[data_header] # take a stat of the grouped data stat = np.median(data_from_group) # add to dictionary group_stats[group] = stat # create violin fig fig = create_violin(df, data_header='Score', group_header='Group', height=600, width=1000, use_colorscale=True, group_stats=group_stats) # plot py.iplot(fig, filename='Violin Plot with Colorscale') ``` """ # Validate colors if isinstance(colors, dict): valid_colors = utils.validate_colors_dict(colors, 'rgb') else: valid_colors = utils.validate_colors(colors, 'rgb') # validate data and choose plot type if group_header is None: if isinstance(data, list): if len(data) <= 0: raise exceptions.PlotlyError("If data is a list, it must be " "nonempty and contain either " "numbers or dictionaries.") if not all(isinstance(element, Number) for element in data): raise exceptions.PlotlyError("If data is a list, it must " "contain only numbers.") if pd and isinstance(data, pd.core.frame.DataFrame): if data_header is None: raise exceptions.PlotlyError("data_header must be the " "column name with the " "desired numeric data for " "the violin plot.") data = data[data_header].values.tolist() # call the plotting functions plot_data, plot_xrange = violinplot(data, fillcolor=valid_colors[0], rugplot=rugplot) layout = graph_objs.Layout( title=title, autosize=False, font=graph_objs.Font(size=11), height=height, showlegend=False, width=width, xaxis=make_XAxis('', plot_xrange), yaxis=make_YAxis(''), hovermode='closest' ) layout['yaxis'].update(dict(showline=False, showticklabels=False, ticks='')) fig = graph_objs.Figure(data=graph_objs.Data(plot_data), layout=layout) return fig else: if not isinstance(data, pd.core.frame.DataFrame): raise exceptions.PlotlyError("Error. You must use a pandas " "DataFrame if you are using a " "group header.") if data_header is None: raise exceptions.PlotlyError("data_header must be the column " "name with the desired numeric " "data for the violin plot.") if use_colorscale is False: if isinstance(valid_colors, dict): # validate colors dict choice below fig = violin_dict( data, data_header, group_header, valid_colors, use_colorscale, group_stats, rugplot, sort, height, width, title ) return fig else: fig = violin_no_colorscale( data, data_header, group_header, valid_colors, use_colorscale, group_stats, rugplot, sort, height, width, title ) return fig else: if isinstance(valid_colors, dict): raise exceptions.PlotlyError("The colors param cannot be " "a dictionary if you are " "using a colorscale.") if len(valid_colors) < 2: raise exceptions.PlotlyError("colors must be a list with " "at least 2 colors. A " "Plotly scale is allowed.") if not isinstance(group_stats, dict): raise exceptions.PlotlyError("Your group_stats param " "must be a dictionary.") fig = violin_colorscale( data, data_header, group_header, valid_colors, use_colorscale, group_stats, rugplot, sort, height, width, title ) return fig plotly-2.2.3+dfsg.orig/plotly/figure_factory/_bullet.py0000644000175000017500000003145113207065466022617 0ustar noahfxnoahfxfrom __future__ import absolute_import import collections import math from plotly import colors, exceptions, optional_imports from plotly.figure_factory import utils import plotly import plotly.graph_objs as go pd = optional_imports.get_module('pandas') def is_sequence(obj): return (isinstance(obj, collections.Sequence) and not isinstance(obj, str)) def _bullet(df, markers, measures, ranges, subtitles, titles, orientation, range_colors, measure_colors, horizontal_spacing, vertical_spacing, scatter_options, layout_options): num_of_lanes = len(df) num_of_rows = num_of_lanes if orientation == 'h' else 1 num_of_cols = 1 if orientation == 'h' else num_of_lanes if not horizontal_spacing: horizontal_spacing = 1./num_of_lanes if not vertical_spacing: vertical_spacing = 1./num_of_lanes fig = plotly.tools.make_subplots( num_of_rows, num_of_cols, print_grid=False, horizontal_spacing=horizontal_spacing, vertical_spacing=vertical_spacing ) # layout fig['layout'].update( dict(shapes=[]), title='Bullet Chart', height=600, width=1000, showlegend=False, barmode='stack', annotations=[], margin=dict(l=120 if orientation == 'h' else 80), ) # update layout fig['layout'].update(layout_options) if orientation == 'h': width_axis = 'yaxis' length_axis = 'xaxis' else: width_axis = 'xaxis' length_axis = 'yaxis' for key in fig['layout'].keys(): if 'axis' in key: fig['layout'][key]['showgrid'] = False fig['layout'][key]['zeroline'] = False if length_axis in key: fig['layout'][key]['tickwidth'] = 1 if width_axis in key: fig['layout'][key]['showticklabels'] = False fig['layout'][key]['range'] = [0, 1] # narrow domain if 1 bar if num_of_lanes <= 1: fig['layout'][width_axis + '1']['domain'] = [0.4, 0.6] if not range_colors: range_colors = ['rgb(200, 200, 200)', 'rgb(245, 245, 245)'] if not measure_colors: measure_colors = ['rgb(31, 119, 180)', 'rgb(176, 196, 221)'] for row in range(num_of_lanes): # ranges bars for idx in range(len(df.iloc[row]['ranges'])): inter_colors = colors.n_colors( range_colors[0], range_colors[1], len(df.iloc[row]['ranges']), 'rgb' ) x = ([sorted(df.iloc[row]['ranges'])[-1 - idx]] if orientation == 'h' else [0]) y = ([0] if orientation == 'h' else [sorted(df.iloc[row]['ranges'])[-1 - idx]]) bar = go.Bar( x=x, y=y, marker=dict( color=inter_colors[-1 - idx] ), name='ranges', hoverinfo='x' if orientation == 'h' else 'y', orientation=orientation, width=2, base=0, xaxis='x{}'.format(row + 1), yaxis='y{}'.format(row + 1) ) fig['data'].append(bar) # measures bars for idx in range(len(df.iloc[row]['measures'])): inter_colors = colors.n_colors( measure_colors[0], measure_colors[1], len(df.iloc[row]['measures']), 'rgb' ) x = ([sorted(df.iloc[row]['measures'])[-1 - idx]] if orientation == 'h' else [0.5]) y = ([0.5] if orientation == 'h' else [sorted(df.iloc[row]['measures'])[-1 - idx]]) bar = go.Bar( x=x, y=y, marker=dict( color=inter_colors[-1 - idx] ), name='measures', hoverinfo='x' if orientation == 'h' else 'y', orientation=orientation, width=0.4, base=0, xaxis='x{}'.format(row + 1), yaxis='y{}'.format(row + 1) ) fig['data'].append(bar) # markers x = df.iloc[row]['markers'] if orientation == 'h' else [0.5] y = [0.5] if orientation == 'h' else df.iloc[row]['markers'] markers = go.Scatter( x=x, y=y, name='markers', hoverinfo='x' if orientation == 'h' else 'y', xaxis='x{}'.format(row + 1), yaxis='y{}'.format(row + 1), **scatter_options ) fig['data'].append(markers) # titles and subtitles title = df.iloc[row]['titles'] if 'subtitles' in df: subtitle = '
{}'.format(df.iloc[row]['subtitles']) else: subtitle = '' label = '{}'.format(title) + subtitle annot = utils.annotation_dict_for_label( label, (num_of_lanes - row if orientation == 'h' else row + 1), num_of_lanes, vertical_spacing if orientation == 'h' else horizontal_spacing, 'row' if orientation == 'h' else 'col', True if orientation == 'h' else False, False ) fig['layout']['annotations'].append(annot) return fig def create_bullet(data, markers=None, measures=None, ranges=None, subtitles=None, titles=None, orientation='h', range_colors=('rgb(200, 200, 200)', 'rgb(245, 245, 245)'), measure_colors=('rgb(31, 119, 180)', 'rgb(176, 196, 221)'), horizontal_spacing=None, vertical_spacing=None, scatter_options={}, **layout_options): """ Returns figure for bullet chart. :param (pd.DataFrame | list | tuple) data: either a list/tuple of dictionaries or a pandas DataFrame. :param (str) markers: the column name or dictionary key for the markers in each subplot. :param (str) measures: the column name or dictionary key for the measure bars in each subplot. This bar usually represents the quantitative measure of performance, usually a list of two values [a, b] and are the blue bars in the foreground of each subplot by default. :param (str) ranges: the column name or dictionary key for the qualitative ranges of performance, usually a 3-item list [bad, okay, good]. They correspond to the grey bars in the background of each chart. :param (str) subtitles: the column name or dictionary key for the subtitle of each subplot chart. The subplots are displayed right underneath each title. :param (str) titles: the column name or dictionary key for the main label of each subplot chart. :param (bool) orientation: if 'h', the bars are placed horizontally as rows. If 'v' the bars are placed vertically in the chart. :param (list) range_colors: a tuple of two colors between which all the rectangles for the range are drawn. These rectangles are meant to be qualitative indicators against which the marker and measure bars are compared. Default=('rgb(200, 200, 200)', 'rgb(245, 245, 245)') :param (list) measure_colors: a tuple of two colors which is used to color the thin quantitative bars in the bullet chart. Default=('rgb(31, 119, 180)', 'rgb(176, 196, 221)') :param (float) horizontal_spacing: see the 'horizontal_spacing' param in plotly.tools.make_subplots. Ranges between 0 and 1. :param (float) vertical_spacing: see the 'vertical_spacing' param in plotly.tools.make_subplots. Ranges between 0 and 1. :param (dict) scatter_options: describes attributes for the scatter trace in each subplot such as name and marker size. Call help(plotly.graph_objs.Scatter) for more information on valid params. :param layout_options: describes attributes for the layout of the figure such as title, height and width. Call help(plotly.graph_objs.Layout) for more information on valid params. Example 1: Use a Dictionary ``` import plotly import plotly.plotly as py import plotly.figure_factory as ff data = [ {"label": "Revenue", "sublabel": "US$, in thousands", "range": [150, 225, 300], "performance": [220,270], "point": [250]}, {"label": "Profit", "sublabel": "%", "range": [20, 25, 30], "performance": [21, 23], "point": [26]}, {"label": "Order Size", "sublabel":"US$, average","range": [350, 500, 600], "performance": [100,320],"point": [550]}, {"label": "New Customers", "sublabel": "count", "range": [1400, 2000, 2500], "performance": [1000, 1650],"point": [2100]}, {"label": "Satisfaction", "sublabel": "out of 5","range": [3.5, 4.25, 5], "performance": [3.2, 4.7], "point": [4.4]} ] fig = ff.create_bullet( data, titles='label', subtitles='sublabel', markers='point', measures='performance', ranges='range', orientation='h', title='my simple bullet chart' ) py.iplot(fig) ``` Example 2: Use a DataFrame with Custom Colors ``` import plotly.plotly as py import plotly.figure_factory as ff import pandas as pd data = pd.read_json('https://cdn.rawgit.com/plotly/datasets/master/BulletData.json') fig = ff.create_bullet( data, titles='title', markers='markers', measures='measures', orientation='v', measure_colors=['rgb(14, 52, 75)', 'rgb(31, 141, 127)'], scatter_options={'marker': {'symbol': 'circle'}}, width=700 ) py.iplot(fig) ``` """ # validate df if not pd: raise exceptions.ImportError( "'pandas' must be installed for this figure factory." ) if is_sequence(data): if not all(isinstance(item, dict) for item in data): raise exceptions.PlotlyError( 'Every entry of the data argument list, tuple, etc must ' 'be a dictionary.' ) elif not isinstance(data, pd.DataFrame): raise exceptions.PlotlyError( 'You must input a pandas DataFrame, or a list of dictionaries.' ) # make DataFrame from data with correct column headers col_names = ['titles', 'subtitle', 'markers', 'measures', 'ranges'] if is_sequence(data): df = pd.DataFrame( [ [d[titles] for d in data] if titles else [''] * len(data), [d[subtitles] for d in data] if subtitles else [''] * len(data), [d[markers] for d in data] if markers else [[]] * len(data), [d[measures] for d in data] if measures else [[]] * len(data), [d[ranges] for d in data] if ranges else [[]] * len(data), ], index=col_names ) elif isinstance(data, pd.DataFrame): df = pd.DataFrame( [ data[titles].tolist() if titles else [''] * len(data), data[subtitles].tolist() if subtitles else [''] * len(data), data[markers].tolist() if markers else [[]] * len(data), data[measures].tolist() if measures else [[]] * len(data), data[ranges].tolist() if ranges else [[]] * len(data), ], index=col_names ) df = pd.DataFrame.transpose(df) # make sure ranges, measures, 'markers' are not NAN or NONE for needed_key in ['ranges', 'measures', 'markers']: for idx, r in enumerate(df[needed_key]): try: r_is_nan = math.isnan(r) if r_is_nan or r is None: df[needed_key][idx] = [] except TypeError: pass # validate custom colors for colors_list in [range_colors, measure_colors]: if colors_list: if len(colors_list) != 2: raise exceptions.PlotlyError( "Both 'range_colors' or 'measure_colors' must be a list " "of two valid colors." ) colors.validate_colors(colors_list) colors_list = colors.convert_colors_to_same_type(colors_list, 'rgb')[0] # default scatter options default_scatter = { 'marker': {'size': 12, 'symbol': 'diamond-tall', 'color': 'rgb(0, 0, 0)'} } if scatter_options == {}: scatter_options.update(default_scatter) else: # add default options to scatter_options if they are not present for k in default_scatter['marker']: if k not in scatter_options['marker']: scatter_options['marker'][k] = default_scatter['marker'][k] fig = _bullet( df, markers, measures, ranges, subtitles, titles, orientation, range_colors, measure_colors, horizontal_spacing, vertical_spacing, scatter_options, layout_options, ) return fig plotly-2.2.3+dfsg.orig/plotly/figure_factory/_scatterplot.py0000644000175000017500000013265013174436015023672 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly import colors, exceptions, optional_imports from plotly.figure_factory import utils from plotly.graph_objs import graph_objs from plotly.tools import make_subplots pd = optional_imports.get_module('pandas') DIAG_CHOICES = ['scatter', 'histogram', 'box'] VALID_COLORMAP_TYPES = ['cat', 'seq'] 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, 6] returns [[-inf, 1], [1, 6], [6, inf]] :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))): 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, str): 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 def hide_tick_labels_from_box_subplots(fig): """ Hides tick labels for box plots in scatterplotmatrix subplots. """ boxplot_xaxes = [] for trace in fig['data']: if trace['type'] == 'box': # stores the xaxes which correspond to boxplot subplots # since we use xaxis1, xaxis2, etc, in plotly.py boxplot_xaxes.append( 'xaxis{}'.format(trace['xaxis'][1:]) ) for xaxis in boxplot_xaxes: fig['layout'][xaxis]['showticklabels'] = False def validate_scatterplotmatrix(df, index, diag, colormap_type, **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 colormap_type is not a valid choice :raises: (PlotlyError) If kwargs contains 'size', 'color' or 'colorscale' """ if not pd: 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" "duce a scatterplot matrix.") # 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 a valid selection if diag not in DIAG_CHOICES: raise exceptions.PlotlyError("Make sure diag is set to " "one of {}".format(DIAG_CHOICES)) # Check that colormap_types is a valid selection if colormap_type not in VALID_COLORMAP_TYPES: raise exceptions.PlotlyError("Must choose a valid colormap type. " "Either 'cat' or 'seq' for a cate" "gorical and sequential colormap " "respectively.") # 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.") def scatterplot(dataframe, headers, diag, size, height, width, title, **kwargs): """ Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix without index """ dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) trace_list = [] # Insert traces into trace_list 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'): trace = graph_objs.Box( y=listx, name=None, showlegend=False ) else: 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) 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]) fig['layout'].update( height=height, width=width, title=title, showlegend=True ) hide_tick_labels_from_box_subplots(fig) return fig def scatterplot_dict(dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs): """ Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix with both index and colormap picked. Used if colormap is a dictionary with index values as keys pointing to colors. Forces colormap_type to behave categorically because it would not make sense colors are assigned to each index value and thus implies that a categorical approach should be taken """ theme = colormap dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) 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] = [] # Fill all the rest of the names into the dictionary for name in sorted(unique_index_vals.keys()): 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[name]), showlegend=True ) elif (listx == listy) and (diag == 'box'): trace = graph_objs.Box( y=new_listx, name=None, marker=dict( color=theme[name]), showlegend=True ) else: if 'marker' in kwargs: kwargs['marker']['size'] = size kwargs['marker']['color'] = theme[name] 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[name]), 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[name]), showlegend=False ) elif (listx == listy) and (diag == 'box'): trace = graph_objs.Box( y=new_listx, name=None, marker=dict( color=theme[name]), showlegend=False ) else: if 'marker' in kwargs: kwargs['marker']['size'] = size kwargs['marker']['color'] = theme[name] 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[name]), showlegend=False, **kwargs ) # Push the trace into dictionary unique_index_vals[name] = trace 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 sorted(trace_list[trace_index].keys()): 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]) hide_tick_labels_from_box_subplots(fig) if diag == 'histogram': fig['layout'].update( height=height, width=width, title=title, showlegend=True, barmode='stack') return fig else: fig['layout'].update( height=height, width=width, title=title, showlegend=True) return fig def scatterplot_theme(dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs): """ Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix with both index and colormap picked """ # Check if index is made of string values if isinstance(index_vals[0], str): 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 colormap to list of n RGB tuples if colormap_type == 'seq': foo = colors.color_parser(colormap, colors.unlabel_rgb) foo = utils.n_colors(foo[0], foo[1], n_colors_len) theme = colors.color_parser(foo, colors.label_rgb) if colormap_type == 'cat': # leave list of colors the same way theme = colormap dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) 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 sorted(unique_index_vals.keys()): 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 sorted(trace_list[trace_index].keys()): 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]) hide_tick_labels_from_box_subplots(fig) 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 = utils.endpts_to_intervals(endpts) # Convert colormap to list of n RGB tuples if colormap_type == 'seq': foo = colors.color_parser(colormap, colors.unlabel_rgb) foo = utils.n_colors(foo[0], foo[1], len(intervals)) theme = colors.color_parser(foo, colors.label_rgb) if colormap_type == 'cat': # leave list of colors the same way theme = colormap dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) 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]) hide_tick_labels_from_box_subplots(fig) 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: theme = colormap # add a copy of rgb color to theme if it contains one color if len(theme) <= 1: theme.append(theme[0]) color = [] for incr in range(len(theme)): color.append([1. / (len(theme) - 1) * incr, theme[incr]]) dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) 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'] = color 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=color, 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'] = color 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=color, 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]) hide_tick_labels_from_box_subplots(fig) 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 def create_scatterplotmatrix(df, index=None, endpts=None, diag='scatter', height=500, width=500, size=6, title='Scatterplot Matrix', colormap=None, colormap_type='cat', dataframe=None, headers=None, index_vals=None, **kwargs): """ Returns data for a 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: takes an increasing sequece of numbers that defines intervals on the real line. They are used to group the entries in an index of numbers into their corresponding interval and therefore can be treated as categorical data :param (str) diag: sets the chart type for the main diagonal plots. The options are 'scatter', 'histogram' and 'box'. :param (int|float) height: sets the height of the chart :param (int|float) width: sets the width of the chart :param (float) size: sets the marker size (in px) :param (str) title: the title label of the scatterplot matrix :param (str|tuple|list|dict) colormap: either a plotly scale name, an rgb or hex color, a color tuple, a list of colors or a dictionary. An rgb color is of the form 'rgb(x, y, z)' where x, y and z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colormap is a list, it must contain valid color types as its members. If colormap is a dictionary, all the string entries in the index column must be a key in colormap. In this case, the colormap_type is forced to 'cat' or categorical :param (str) colormap_type: determines how colormap is interpreted. Valid choices are 'seq' (sequential) and 'cat' (categorical). If 'seq' is selected, only the first two colors in colormap will be considered (when colormap is a list) and the index values will be linearly interpolated between those two colors. This option is forced if all index values are numeric. If 'cat' is selected, a color from colormap will be assigned to each category from index, including the intervals if endpts is being used :param (dict) **kwargs: a dictionary of scatterplot arguments The only forbidden parameters are 'size', 'color' and 'colorscale' in 'marker' Example 1: Vanilla Scatterplot Matrix ``` import plotly.plotly as py from plotly.graph_objs import graph_objs from plotly.figure_factory import create_scatterplotmatrix import numpy as np import pandas as pd # Create dataframe df = pd.DataFrame(np.random.randn(10, 2), columns=['Column 1', 'Column 2']) # Create scatterplot matrix fig = create_scatterplotmatrix(df) # Plot py.iplot(fig, filename='Vanilla Scatterplot Matrix') ``` Example 2: Indexing a Column ``` import plotly.plotly as py from plotly.graph_objs import graph_objs from plotly.figure_factory import create_scatterplotmatrix import numpy as np import pandas as pd # Create dataframe with index df = pd.DataFrame(np.random.randn(10, 2), 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 = create_scatterplotmatrix(df, index='Fruit', size=10) # Plot py.iplot(fig, filename = 'Scatterplot Matrix with Index') ``` Example 3: Styling the Diagonal Subplots ``` import plotly.plotly as py from plotly.graph_objs import graph_objs from plotly.figure_factory import create_scatterplotmatrix import numpy as np import pandas as pd # Create dataframe with index df = pd.DataFrame(np.random.randn(10, 4), 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 = create_scatterplotmatrix(df, diag='box', index='Fruit', height=1000, width=1000) # Plot py.iplot(fig, filename = 'Scatterplot Matrix - Diagonal Styling') ``` Example 4: Use a Theme to Style the Subplots ``` import plotly.plotly as py from plotly.graph_objs import graph_objs from plotly.figure_factory import create_scatterplotmatrix 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 = create_scatterplotmatrix(df, diag='histogram', index='A', colormap='Blues', height=800, width=800) # Plot py.iplot(fig, filename = 'Scatterplot Matrix - Colormap Theme') ``` Example 5: Example 4 with Interval Factoring ``` import plotly.plotly as py from plotly.graph_objs import graph_objs from plotly.figure_factory import create_scatterplotmatrix 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 = create_scatterplotmatrix(df, diag='histogram', index='A', colormap=['rgb(140, 255, 50)', 'rgb(170, 60, 115)', '#6c4774', (0.5, 0.1, 0.8)], endpts=[-1, 0, 1], height=800, width=800) # Plot py.iplot(fig, filename = 'Scatterplot Matrix - Intervals') ``` Example 6: Using the colormap as a Dictionary ``` import plotly.plotly as py from plotly.graph_objs import graph_objs from plotly.figure_factory import create_scatterplotmatrix import numpy as np import pandas as pd import random # Create dataframe with random data df = pd.DataFrame(np.random.randn(100, 3), columns=['Column A', 'Column B', 'Column C']) # Add new color column to dataframe new_column = [] strange_colors = ['turquoise', 'limegreen', 'goldenrod'] for j in range(100): new_column.append(random.choice(strange_colors)) df['Colors'] = pd.Series(new_column, index=df.index) # Create scatterplot matrix using a dictionary of hex color values # which correspond to actual color names in 'Colors' column fig = create_scatterplotmatrix( df, diag='box', index='Colors', colormap= dict( turquoise = '#00F5FF', limegreen = '#32CD32', goldenrod = '#DAA520' ), colormap_type='cat', height=800, width=800 ) # Plot py.iplot(fig, filename = 'Scatterplot Matrix - colormap dictionary ') ``` """ # TODO: protected until #282 if dataframe is None: dataframe = [] if headers is None: headers = [] if index_vals is None: index_vals = [] validate_scatterplotmatrix(df, index, diag, colormap_type, **kwargs) # Validate colormap if isinstance(colormap, dict): colormap = utils.validate_colors_dict(colormap, 'rgb') else: colormap = utils.validate_colors(colormap, 'rgb') if not index: for name in df: headers.append(name) for name in headers: dataframe.append(df[name].values.tolist()) # Check for same data-type in df columns utils.validate_dataframe(dataframe) figure = scatterplot(dataframe, headers, diag, size, height, width, title, **kwargs) return figure else: # Validate index selection 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.") index_vals = df[index].values.tolist() for name in df: if name != index: headers.append(name) for name in headers: dataframe.append(df[name].values.tolist()) # check for same data-type in each df column utils.validate_dataframe(dataframe) utils.validate_index(index_vals) # check if all colormap keys are in the index # if colormap is a dictionary if isinstance(colormap, dict): for key in colormap: if not all(index in colormap for index in index_vals): raise exceptions.PlotlyError("If colormap is a " "dictionary, all the " "names in the index " "must be keys.") figure = scatterplot_dict( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs ) return figure else: figure = scatterplot_theme( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs ) return figure plotly-2.2.3+dfsg.orig/plotly/figure_factory/_table.py0000644000175000017500000002220313107655313022405 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly import exceptions, optional_imports from plotly.graph_objs import graph_objs pd = optional_imports.get_module('pandas') def validate_table(table_text, font_colors): """ Table-specific validations Check that font_colors is supplied correctly (1, 3, or len(text) colors). :raises: (PlotlyError) If font_colors is supplied incorretly. See FigureFactory.create_table() for params """ font_colors_len_options = [1, 3, len(table_text)] if len(font_colors) not in font_colors_len_options: raise exceptions.PlotlyError("Oops, font_colors should be a list " "of length 1, 3 or len(text)") def create_table(table_text, colorscale=None, font_colors=None, index=False, index_title='', annotation_offset=.45, height_constant=30, hoverinfo='none', **kwargs): """ BETA function that creates data tables :param (pandas.Dataframe | list[list]) text: data for table. :param (str|list[list]) colorscale: Colorscale for table where the color at value 0 is the header color, .5 is the first table color and 1 is the second table color. (Set .5 and 1 to avoid the striped table effect). Default=[[0, '#66b2ff'], [.5, '#d9d9d9'], [1, '#ffffff']] :param (list) font_colors: Color for fonts in table. Can be a single color, three colors, or a color for each row in the table. Default=['#000000'] (black text for the entire table) :param (int) height_constant: Constant multiplied by # of rows to create table height. Default=30. :param (bool) index: Create (header-colored) index column index from Pandas dataframe or list[0] for each list in text. Default=False. :param (string) index_title: Title for index column. Default=''. :param kwargs: kwargs passed through plotly.graph_objs.Heatmap. These kwargs describe other attributes about the annotated Heatmap trace such as the colorscale. For more information on valid kwargs call help(plotly.graph_objs.Heatmap) Example 1: Simple Plotly Table ``` import plotly.plotly as py from plotly.figure_factory import create_table text = [['Country', 'Year', 'Population'], ['US', 2000, 282200000], ['Canada', 2000, 27790000], ['US', 2010, 309000000], ['Canada', 2010, 34000000]] table = create_table(text) py.iplot(table) ``` Example 2: Table with Custom Coloring ``` import plotly.plotly as py from plotly.figure_factory import create_table text = [['Country', 'Year', 'Population'], ['US', 2000, 282200000], ['Canada', 2000, 27790000], ['US', 2010, 309000000], ['Canada', 2010, 34000000]] table = create_table(text, colorscale=[[0, '#000000'], [.5, '#80beff'], [1, '#cce5ff']], font_colors=['#ffffff', '#000000', '#000000']) py.iplot(table) ``` Example 3: Simple Plotly Table with Pandas ``` import plotly.plotly as py from plotly.figure_factory import create_table import pandas as pd df = pd.read_csv('http://www.stat.ubc.ca/~jenny/notOcto/STAT545A/examples/gapminder/data/gapminderDataFiveYear.txt', sep='\t') df_p = df[0:25] table_simple = create_table(df_p) py.iplot(table_simple) ``` """ # Avoiding mutables in the call signature colorscale = \ colorscale if colorscale is not None else [[0, '#00083e'], [.5, '#ededee'], [1, '#ffffff']] font_colors = font_colors if font_colors is not None else ['#ffffff', '#000000', '#000000'] validate_table(table_text, font_colors) table_matrix = _Table(table_text, colorscale, font_colors, index, index_title, annotation_offset, **kwargs).get_table_matrix() annotations = _Table(table_text, colorscale, font_colors, index, index_title, annotation_offset, **kwargs).make_table_annotations() trace = dict(type='heatmap', z=table_matrix, opacity=.75, colorscale=colorscale, showscale=False, hoverinfo=hoverinfo, **kwargs) data = [trace] layout = dict(annotations=annotations, height=len(table_matrix) * height_constant + 50, margin=dict(t=0, b=0, r=0, l=0), yaxis=dict(autorange='reversed', zeroline=False, gridwidth=2, ticks='', dtick=1, tick0=.5, showticklabels=False), xaxis=dict(zeroline=False, gridwidth=2, ticks='', dtick=1, tick0=-0.5, showticklabels=False)) return graph_objs.Figure(data=data, layout=layout) class _Table(object): """ Refer to TraceFactory.create_table() for docstring """ def __init__(self, table_text, colorscale, font_colors, index, index_title, annotation_offset, **kwargs): if pd and isinstance(table_text, pd.DataFrame): headers = table_text.columns.tolist() table_text_index = table_text.index.tolist() table_text = table_text.values.tolist() table_text.insert(0, headers) if index: table_text_index.insert(0, index_title) for i in range(len(table_text)): table_text[i].insert(0, table_text_index[i]) self.table_text = table_text self.colorscale = colorscale self.font_colors = font_colors self.index = index self.annotation_offset = annotation_offset self.x = range(len(table_text[0])) self.y = range(len(table_text)) def get_table_matrix(self): """ Create z matrix to make heatmap with striped table coloring :rtype (list[list]) table_matrix: z matrix to make heatmap with striped table coloring. """ header = [0] * len(self.table_text[0]) odd_row = [.5] * len(self.table_text[0]) even_row = [1] * len(self.table_text[0]) table_matrix = [None] * len(self.table_text) table_matrix[0] = header for i in range(1, len(self.table_text), 2): table_matrix[i] = odd_row for i in range(2, len(self.table_text), 2): table_matrix[i] = even_row if self.index: for array in table_matrix: array[0] = 0 return table_matrix def get_table_font_color(self): """ Fill font-color array. Table text color can vary by row so this extends a single color or creates an array to set a header color and two alternating colors to create the striped table pattern. :rtype (list[list]) all_font_colors: list of font colors for each row in table. """ if len(self.font_colors) == 1: all_font_colors = self.font_colors*len(self.table_text) elif len(self.font_colors) == 3: all_font_colors = list(range(len(self.table_text))) all_font_colors[0] = self.font_colors[0] for i in range(1, len(self.table_text), 2): all_font_colors[i] = self.font_colors[1] for i in range(2, len(self.table_text), 2): all_font_colors[i] = self.font_colors[2] elif len(self.font_colors) == len(self.table_text): all_font_colors = self.font_colors else: all_font_colors = ['#000000']*len(self.table_text) return all_font_colors def make_table_annotations(self): """ Generate annotations to fill in table text :rtype (list) annotations: list of annotations for each cell of the table. """ table_matrix = _Table.get_table_matrix(self) all_font_colors = _Table.get_table_font_color(self) annotations = [] for n, row in enumerate(self.table_text): for m, val in enumerate(row): # Bold text in header and index format_text = ('' + str(val) + '' if n == 0 or self.index and m < 1 else str(val)) # Match font color of index to font color of header font_color = (self.font_colors[0] if self.index and m == 0 else all_font_colors[n]) annotations.append( graph_objs.Annotation( text=format_text, x=self.x[m] - self.annotation_offset, y=self.y[n], xref='x1', yref='y1', align="left", xanchor="left", font=dict(color=font_color), showarrow=False)) return annotations plotly-2.2.3+dfsg.orig/plotly/figure_factory/__init__.py0000644000175000017500000000177313207065466022734 0ustar noahfxnoahfxfrom __future__ import absolute_import # Require that numpy exists for figure_factory import numpy from plotly.figure_factory._2d_density import create_2d_density from plotly.figure_factory._annotated_heatmap import create_annotated_heatmap from plotly.figure_factory._bullet import create_bullet from plotly.figure_factory._candlestick import create_candlestick from plotly.figure_factory._dendrogram import create_dendrogram from plotly.figure_factory._distplot import create_distplot from plotly.figure_factory._facet_grid import create_facet_grid from plotly.figure_factory._gantt import create_gantt from plotly.figure_factory._ohlc import create_ohlc from plotly.figure_factory._quiver import create_quiver from plotly.figure_factory._scatterplot import create_scatterplotmatrix from plotly.figure_factory._streamline import create_streamline from plotly.figure_factory._table import create_table from plotly.figure_factory._trisurf import create_trisurf from plotly.figure_factory._violin import create_violin plotly-2.2.3+dfsg.orig/plotly/session.py0000644000175000017500000001251513104403274017631 0ustar noahfxnoahfx""" The session module handles the user's current credentials, config and plot opts This allows users to dynamically change which plotly domain they're using, which user they're signed in as, and plotting defaults. """ from __future__ import absolute_import import copy import six from plotly import exceptions _session = { 'credentials': {}, 'config': {}, 'plot_options': {} } CREDENTIALS_KEYS = { 'username': six.string_types, 'api_key': six.string_types, 'proxy_username': six.string_types, 'proxy_password': six.string_types, 'stream_ids': list } CONFIG_KEYS = { 'plotly_domain': six.string_types, 'plotly_streaming_domain': six.string_types, 'plotly_api_domain': six.string_types, 'plotly_ssl_verification': bool, 'plotly_proxy_authorization': bool, 'world_readable': bool, 'auto_open': bool, 'sharing': six.string_types } PLOT_OPTIONS = { 'filename': six.string_types, 'fileopt': six.string_types, 'validate': bool, 'world_readable': bool, 'auto_open': bool, 'sharing': six.string_types } SHARING_OPTIONS = ['public', 'private', 'secret'] def sign_in(username, api_key, **kwargs): """ Set set session credentials and config (not saved to file). If unspecified, credentials and config are searched for in `.plotly` dir. :param (str) username: The username you'd use to sign in to Plotly :param (str) api_key: The api key associated with above username :param (list|optional) stream_ids: Stream tokens for above credentials :param (str|optional) proxy_username: The un associated with with your Proxy :param (str|optional) proxy_password: The pw associated with your Proxy un :param (str|optional) plotly_domain: :param (str|optional) plotly_streaming_domain: :param (str|optional) plotly_api_domain: :param (bool|optional) plotly_ssl_verification: :param (bool|optional) plotly_proxy_authorization: :param (bool|optional) world_readable: """ # TODO: verify these _credentials with plotly # kwargs will contain all our info kwargs.update(username=username, api_key=api_key) # raise error if key isn't valid anywhere for key in kwargs: if key not in CREDENTIALS_KEYS and key not in CONFIG_KEYS: raise exceptions.PlotlyError( "{} is not a valid config or credentials key".format(key) ) # add credentials, raise error if type is wrong. for key in CREDENTIALS_KEYS: if key in kwargs: if not isinstance(kwargs[key], CREDENTIALS_KEYS[key]): raise exceptions.PlotlyError( "{} must be of type '{}'" .format(key, CREDENTIALS_KEYS[key]) ) _session['credentials'][key] = kwargs[key] # add config, raise error if type is wrong. for key in CONFIG_KEYS: if key in kwargs: if not isinstance(kwargs[key], CONFIG_KEYS[key]): raise exceptions.PlotlyError("{} must be of type '{}'" .format(key, CONFIG_KEYS[key])) _session['config'][key] = kwargs.get(key) # add plot options, raise error if type is wrong. for key in PLOT_OPTIONS: if key in kwargs: if not isinstance(kwargs[key], CONFIG_KEYS[key]): raise exceptions.PlotlyError("{} must be of type '{}'" .format(key, CONFIG_KEYS[key])) _session['plot_options'][key] = kwargs.get(key) def update_session_plot_options(**kwargs): """ Update the _session plot_options :param (str|optional) filename: What the file will be named in Plotly :param (str|optional) fileopt: 'overwrite', 'append', 'new', or 'extend' :param (bool|optional) world_readable: Make public or private. :param (dict|optional) sharing: 'public', 'private', 'secret' :param (bool|optional) auto_open: For `plot`, open in new browser tab? :param (bool|optional) validate: Error locally if data doesn't pass? """ # raise exception if key is invalid or value is the wrong type for key in kwargs: if key not in PLOT_OPTIONS: raise exceptions.PlotlyError( "{} is not a valid config or plot option key".format(key) ) if not isinstance(kwargs[key], PLOT_OPTIONS[key]): raise exceptions.PlotlyError("{} must be of type '{}'" .format(key, PLOT_OPTIONS[key])) # raise exception if sharing is invalid if (key == 'sharing' and not (kwargs[key] in SHARING_OPTIONS)): raise exceptions.PlotlyError("'{0}' must be of either '{1}', '{2}'" " or '{3}'" .format(key, *SHARING_OPTIONS)) # update local _session dict with new plot options _session['plot_options'].update(kwargs) def get_session_plot_options(): """ Returns a copy of the user supplied plot options. Use `update_plot_options()` to change. """ return copy.deepcopy(_session['plot_options']) def get_session_config(): """Returns either module config or file config.""" return copy.deepcopy(_session['config']) def get_session_credentials(): """Returns the credentials that will be sent to plotly.""" return copy.deepcopy(_session['credentials']) plotly-2.2.3+dfsg.orig/plotly/offline/0000755000175000017500000000000013211605515017213 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/offline/offline.py0000644000175000017500000007070713136102462021221 0ustar noahfxnoahfx""" Plotly Offline A module to use Plotly's graphing library with Python without connecting to a public or private plotly enterprise server. """ from __future__ import absolute_import import os import uuid import warnings from pkg_resources import resource_string import time import webbrowser from requests.compat import json as _json import plotly from plotly import optional_imports, tools, utils from plotly.exceptions import PlotlyError ipython = optional_imports.get_module('IPython') ipython_display = optional_imports.get_module('IPython.display') matplotlib = optional_imports.get_module('matplotlib') __PLOTLY_OFFLINE_INITIALIZED = False __IMAGE_FORMATS = ['jpeg', 'png', 'webp', 'svg'] def download_plotlyjs(download_url): warnings.warn(''' `download_plotlyjs` is deprecated and will be removed in the next release. plotly.js is shipped with this module, it is no longer necessary to download this bundle separately. ''', DeprecationWarning) pass def get_plotlyjs(): path = os.path.join('package_data', 'plotly.min.js') plotlyjs = resource_string('plotly', path).decode('utf-8') return plotlyjs def get_image_download_script(caller): """ This function will return a script that will download an image of a Plotly plot. Keyword Arguments: caller ('plot', 'iplot') -- specifies which function made the call for the download script. If `iplot`, then an extra condition is added into the download script to ensure that download prompts aren't initiated on page reloads. """ if caller == 'iplot': check_start = 'if(document.readyState == \'complete\') {{' check_end = '}}' elif caller == 'plot': check_start = '' check_end = '' else: raise ValueError('caller should only be one of `iplot` or `plot`') return( ('') ) def init_notebook_mode(connected=False): """ Initialize plotly.js in the browser if it hasn't been loaded into the DOM yet. This is an idempotent method and can and should be called from any offline methods that require plotly.js to be loaded into the notebook dom. Keyword arguments: connected (default=False) -- If True, the plotly.js library will be loaded from an online CDN. If False, the plotly.js library will be loaded locally from the plotly python package Use `connected=True` if you want your notebooks to have smaller file sizes. In the case where `connected=False`, the entirety of the plotly.js library will be loaded into the notebook, which will result in a file-size increase of a couple megabytes. Additionally, because the library will be downloaded from the web, you and your viewers must be connected to the internet to be able to view charts within this notebook. Use `connected=False` if you want you and your collaborators to be able to create and view these charts regardless of the availability of an internet connection. This is the default option since it is the most predictable. Note that under this setting the library will be included inline inside your notebook, resulting in much larger notebook sizes compared to the case where `connected=True`. """ if not ipython: raise ImportError('`iplot` can only run inside an IPython Notebook.') global __PLOTLY_OFFLINE_INITIALIZED if connected: # Inject plotly.js into the output cell script_inject = ( '' '' ) else: # Inject plotly.js into the output cell script_inject = ( '' '' '').format(script=get_plotlyjs()) display_bundle = { 'text/html': script_inject, 'text/vnd.plotly.v1+html': script_inject } ipython_display.display(display_bundle, raw=True) __PLOTLY_OFFLINE_INITIALIZED = True def _plot_html(figure_or_data, config, validate, default_width, default_height, global_requirejs): # force no validation if frames is in the call # TODO - add validation for frames in call - #605 if 'frames' in figure_or_data: figure = tools.return_figure_from_figure_or_data( figure_or_data, False ) else: figure = tools.return_figure_from_figure_or_data( figure_or_data, validate ) width = figure.get('layout', {}).get('width', default_width) height = figure.get('layout', {}).get('height', default_height) try: float(width) except (ValueError, TypeError): pass else: width = str(width) + 'px' try: float(height) except (ValueError, TypeError): pass else: height = str(height) + 'px' plotdivid = uuid.uuid4() jdata = _json.dumps(figure.get('data', []), cls=utils.PlotlyJSONEncoder) jlayout = _json.dumps(figure.get('layout', {}), cls=utils.PlotlyJSONEncoder) if 'frames' in figure_or_data: jframes = _json.dumps(figure.get('frames', {}), cls=utils.PlotlyJSONEncoder) configkeys = ( 'editable', 'autosizable', 'fillFrame', 'frameMargins', 'scrollZoom', 'doubleClick', 'showTips', 'showLink', 'sendData', 'linkText', 'showSources', 'displayModeBar', 'modeBarButtonsToRemove', 'modeBarButtonsToAdd', 'modeBarButtons', 'displaylogo', 'plotGlPixelRatio', 'setBackground', 'topojsonURL' ) config_clean = dict((k, config[k]) for k in configkeys if k in config) jconfig = _json.dumps(config_clean) # TODO: The get_config 'source of truth' should # really be somewhere other than plotly.plotly plotly_platform_url = plotly.plotly.get_config().get('plotly_domain', 'https://plot.ly') if (plotly_platform_url != 'https://plot.ly' and config['linkText'] == 'Export to plot.ly'): link_domain = plotly_platform_url\ .replace('https://', '')\ .replace('http://', '') link_text = config['linkText'].replace('plot.ly', link_domain) config['linkText'] = link_text jconfig = jconfig.replace('Export to plot.ly', link_text) if 'frames' in figure_or_data: script = ''' Plotly.plot( '{id}', {data}, {layout}, {config} ).then(function () {add_frames}).then(function(){animate}) '''.format( id=plotdivid, data=jdata, layout=jlayout, config=jconfig, add_frames="{" + "return Plotly.addFrames('{id}',{frames}".format( id=plotdivid, frames=jframes ) + ");}", animate="{" + "Plotly.animate('{id}');".format(id=plotdivid) + "}" ) else: script = 'Plotly.newPlot("{id}", {data}, {layout}, {config})'.format( id=plotdivid, data=jdata, layout=jlayout, config=jconfig) optional_line1 = ('require(["plotly"], function(Plotly) {{ ' if global_requirejs else '') optional_line2 = ('}});' if global_requirejs else '') plotly_html_div = ( '' '
' '
' '' '').format( id=plotdivid, script=script, height=height, width=width) return plotly_html_div, plotdivid, width, height def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly', validate=True, image=None, filename='plot_image', image_width=800, image_height=600, config=None): """ Draw plotly graphs inside an IPython or Jupyter notebook without connecting to an external server. To save the chart to Plotly Cloud or Plotly Enterprise, use `plotly.plotly.iplot`. To embed an image of the chart, use `plotly.image.ishow`. figure_or_data -- a plotly.graph_objs.Figure or plotly.graph_objs.Data or dict or list that describes a Plotly graph. See https://plot.ly/python/ for examples of graph descriptions. Keyword arguments: show_link (default=True) -- display a link in the bottom-right corner of of the chart that will export the chart to Plotly Cloud or Plotly Enterprise link_text (default='Export to plot.ly') -- the text of export link validate (default=True) -- validate that all of the keys in the figure are valid? omit if your version of plotly.js has become outdated with your version of graph_reference.json or if you need to include extra, unnecessary keys in your figure. image (default=None |'png' |'jpeg' |'svg' |'webp') -- This parameter sets the format of the image to be downloaded, if we choose to download an image. This parameter has a default value of None indicating that no image should be downloaded. Please note: for higher resolution images and more export options, consider making requests to our image servers. Type: `help(py.image)` for more details. filename (default='plot') -- Sets the name of the file your image will be saved to. The extension should not be included. image_height (default=600) -- Specifies the height of the image in `px`. image_width (default=800) -- Specifies the width of the image in `px`. config (default=None) -- Plot view options dictionary. Keyword arguments `show_link` and `link_text` set the associated options in this dictionary if it doesn't contain them already. Example: ``` from plotly.offline import init_notebook_mode, iplot init_notebook_mode() iplot([{'x': [1, 2, 3], 'y': [5, 2, 7]}]) # We can also download an image of the plot by setting the image to the format you want. e.g. `image='png'` iplot([{'x': [1, 2, 3], 'y': [5, 2, 7]}], image='png') ``` """ if not ipython: raise ImportError('`iplot` can only run inside an IPython Notebook.') config = dict(config) if config else {} config.setdefault('showLink', show_link) config.setdefault('linkText', link_text) figure = tools.return_figure_from_figure_or_data(figure_or_data, validate) # Though it can add quite a bit to the display-bundle size, we include # multiple representations of the plot so that the display environment can # choose which one to act on. data = _json.loads(_json.dumps(figure['data'], cls=plotly.utils.PlotlyJSONEncoder)) layout = _json.loads(_json.dumps(figure.get('layout', {}), cls=plotly.utils.PlotlyJSONEncoder)) frames = _json.loads(_json.dumps(figure.get('frames', None), cls=plotly.utils.PlotlyJSONEncoder)) fig = {'data': data, 'layout': layout} if frames: fig['frames'] = frames display_bundle = {'application/vnd.plotly.v1+json': fig} if __PLOTLY_OFFLINE_INITIALIZED: plot_html, plotdivid, width, height = _plot_html( figure_or_data, config, validate, '100%', 525, True ) display_bundle['text/html'] = plot_html display_bundle['text/vnd.plotly.v1+html'] = plot_html ipython_display.display(display_bundle, raw=True) if image: if not __PLOTLY_OFFLINE_INITIALIZED: raise PlotlyError('\n'.join([ 'Plotly Offline mode has not been initialized in this notebook. ' 'Run: ', '', 'import plotly', 'plotly.offline.init_notebook_mode() ' '# run at the start of every ipython notebook', ])) if image not in __IMAGE_FORMATS: raise ValueError('The image parameter must be one of the following' ': {}'.format(__IMAGE_FORMATS) ) # if image is given, and is a valid format, we will download the image script = get_image_download_script('iplot').format(format=image, width=image_width, height=image_height, filename=filename, plot_id=plotdivid) # allow time for the plot to draw time.sleep(1) # inject code to download an image of the plot ipython_display.display(ipython_display.HTML(script)) def plot(figure_or_data, show_link=True, link_text='Export to plot.ly', validate=True, output_type='file', include_plotlyjs=True, filename='temp-plot.html', auto_open=True, image=None, image_filename='plot_image', image_width=800, image_height=600, config=None): """ Create a plotly graph locally as an HTML document or string. Example: ``` from plotly.offline import plot import plotly.graph_objs as go plot([go.Scatter(x=[1, 2, 3], y=[3, 2, 6])], filename='my-graph.html') # We can also download an image of the plot by setting the image parameter # to the image format we want plot([go.Scatter(x=[1, 2, 3], y=[3, 2, 6])], filename='my-graph.html' image='jpeg') ``` More examples below. figure_or_data -- a plotly.graph_objs.Figure or plotly.graph_objs.Data or dict or list that describes a Plotly graph. See https://plot.ly/python/ for examples of graph descriptions. Keyword arguments: show_link (default=True) -- display a link in the bottom-right corner of of the chart that will export the chart to Plotly Cloud or Plotly Enterprise link_text (default='Export to plot.ly') -- the text of export link validate (default=True) -- validate that all of the keys in the figure are valid? omit if your version of plotly.js has become outdated with your version of graph_reference.json or if you need to include extra, unnecessary keys in your figure. output_type ('file' | 'div' - default 'file') -- if 'file', then the graph is saved as a standalone HTML file and `plot` returns None. If 'div', then `plot` returns a string that just contains the HTML
that contains the graph and the script to generate the graph. Use 'file' if you want to save and view a single graph at a time in a standalone HTML file. Use 'div' if you are embedding these graphs in an HTML file with other graphs or HTML markup, like a HTML report or an website. include_plotlyjs (default=True) -- If True, include the plotly.js source code in the output file or string. Set as False if your HTML file already contains a copy of the plotly.js library. filename (default='temp-plot.html') -- The local filename to save the outputted chart to. If the filename already exists, it will be overwritten. This argument only applies if `output_type` is 'file'. auto_open (default=True) -- If True, open the saved file in a web browser after saving. This argument only applies if `output_type` is 'file'. image (default=None |'png' |'jpeg' |'svg' |'webp') -- This parameter sets the format of the image to be downloaded, if we choose to download an image. This parameter has a default value of None indicating that no image should be downloaded. Please note: for higher resolution images and more export options, consider making requests to our image servers. Type: `help(py.image)` for more details. image_filename (default='plot_image') -- Sets the name of the file your image will be saved to. The extension should not be included. image_height (default=600) -- Specifies the height of the image in `px`. image_width (default=800) -- Specifies the width of the image in `px`. config (default=None) -- Plot view options dictionary. Keyword arguments `show_link` and `link_text` set the associated options in this dictionary if it doesn't contain them already. """ if output_type not in ['div', 'file']: raise ValueError( "`output_type` argument must be 'div' or 'file'. " "You supplied `" + output_type + "``") if not filename.endswith('.html') and output_type == 'file': warnings.warn( "Your filename `" + filename + "` didn't end with .html. " "Adding .html to the end of your file.") filename += '.html' config = dict(config) if config else {} config.setdefault('showLink', show_link) config.setdefault('linkText', link_text) plot_html, plotdivid, width, height = _plot_html( figure_or_data, config, validate, '100%', '100%', global_requirejs=False) resize_script = '' if width == '100%' or height == '100%': resize_script = ( '' '' ).format(id=plotdivid) if output_type == 'file': with open(filename, 'w') as f: if include_plotlyjs: plotly_js_script = ''.join([ '', ]) else: plotly_js_script = '' if image: if image not in __IMAGE_FORMATS: raise ValueError('The image parameter must be one of the ' 'following: {}'.format(__IMAGE_FORMATS) ) # if the check passes then download script is injected. # write the download script: script = get_image_download_script('plot') script = script.format(format=image, width=image_width, height=image_height, filename=image_filename, plot_id=plotdivid) else: script = '' f.write(''.join([ '', '', '', plotly_js_script, plot_html, resize_script, script, '', ''])) url = 'file://' + os.path.abspath(filename) if auto_open: webbrowser.open(url) return url elif output_type == 'div': if include_plotlyjs: return ''.join([ '
', '', plot_html, resize_script, '
', ]) else: return plot_html def plot_mpl(mpl_fig, resize=False, strip_style=False, verbose=False, show_link=True, link_text='Export to plot.ly', validate=True, output_type='file', include_plotlyjs=True, filename='temp-plot.html', auto_open=True, image=None, image_filename='plot_image', image_height=600, image_width=800): """ Convert a matplotlib figure to a Plotly graph stored locally as HTML. For more information on converting matplotlib visualizations to plotly graphs, call help(plotly.tools.mpl_to_plotly) For more information on creating plotly charts locally as an HTML document or string, call help(plotly.offline.plot) mpl_fig -- a matplotlib figure object to convert to a plotly graph Keyword arguments: resize (default=False) -- allow plotly to choose the figure size. strip_style (default=False) -- allow plotly to choose style options. verbose (default=False) -- print message. show_link (default=True) -- display a link in the bottom-right corner of of the chart that will export the chart to Plotly Cloud or Plotly Enterprise link_text (default='Export to plot.ly') -- the text of export link validate (default=True) -- validate that all of the keys in the figure are valid? omit if your version of plotly.js has become outdated with your version of graph_reference.json or if you need to include extra, unnecessary keys in your figure. output_type ('file' | 'div' - default 'file') -- if 'file', then the graph is saved as a standalone HTML file and `plot` returns None. If 'div', then `plot` returns a string that just contains the HTML
that contains the graph and the script to generate the graph. Use 'file' if you want to save and view a single graph at a time in a standalone HTML file. Use 'div' if you are embedding these graphs in an HTML file with other graphs or HTML markup, like a HTML report or an website. include_plotlyjs (default=True) -- If True, include the plotly.js source code in the output file or string. Set as False if your HTML file already contains a copy of the plotly.js library. filename (default='temp-plot.html') -- The local filename to save the outputted chart to. If the filename already exists, it will be overwritten. This argument only applies if `output_type` is 'file'. auto_open (default=True) -- If True, open the saved file in a web browser after saving. This argument only applies if `output_type` is 'file'. image (default=None |'png' |'jpeg' |'svg' |'webp') -- This parameter sets the format of the image to be downloaded, if we choose to download an image. This parameter has a default value of None indicating that no image should be downloaded. image_filename (default='plot_image') -- Sets the name of the file your image will be saved to. The extension should not be included. image_height (default=600) -- Specifies the height of the image in `px`. image_width (default=800) -- Specifies the width of the image in `px`. Example: ``` from plotly.offline import init_notebook_mode, plot_mpl import matplotlib.pyplot as plt init_notebook_mode() fig = plt.figure() x = [10, 15, 20, 25, 30] y = [100, 250, 200, 150, 300] plt.plot(x, y, "o") plot_mpl(fig) # If you want to to download an image of the figure as well plot_mpl(fig, image='png') ``` """ plotly_plot = tools.mpl_to_plotly(mpl_fig, resize, strip_style, verbose) return plot(plotly_plot, show_link, link_text, validate, output_type, include_plotlyjs, filename, auto_open, image=image, image_filename=image_filename, image_height=image_height, image_width=image_width) def iplot_mpl(mpl_fig, resize=False, strip_style=False, verbose=False, show_link=True, link_text='Export to plot.ly', validate=True, image=None, image_filename='plot_image', image_height=600, image_width=800): """ Convert a matplotlib figure to a plotly graph and plot inside an IPython notebook without connecting to an external server. To save the chart to Plotly Cloud or Plotly Enterprise, use `plotly.plotly.plot_mpl`. For more information on converting matplotlib visualizations to plotly graphs call `help(plotly.tools.mpl_to_plotly)` For more information on plotting plotly charts offline in an Ipython notebook call `help(plotly.offline.iplot)` mpl_fig -- a matplotlib.figure to convert to a plotly graph Keyword arguments: resize (default=False) -- allow plotly to choose the figure size. strip_style (default=False) -- allow plotly to choose style options. verbose (default=False) -- print message. show_link (default=True) -- display a link in the bottom-right corner of of the chart that will export the chart to Plotly Cloud or Plotly Enterprise link_text (default='Export to plot.ly') -- the text of export link validate (default=True) -- validate that all of the keys in the figure are valid? omit if your version of plotly.js has become outdated with your version of graph_reference.json or if you need to include extra, unnecessary keys in your figure. image (default=None |'png' |'jpeg' |'svg' |'webp') -- This parameter sets the format of the image to be downloaded, if we choose to download an image. This parameter has a default value of None indicating that no image should be downloaded. image_filename (default='plot_image') -- Sets the name of the file your image will be saved to. The extension should not be included. image_height (default=600) -- Specifies the height of the image in `px`. image_width (default=800) -- Specifies the width of the image in `px`. Example: ``` from plotly.offline import init_notebook_mode, iplot_mpl import matplotlib.pyplot as plt fig = plt.figure() x = [10, 15, 20, 25, 30] y = [100, 250, 200, 150, 300] plt.plot(x, y, "o") init_notebook_mode() iplot_mpl(fig) # and if you want to download an image of the figure as well iplot_mpl(fig, image='jpeg') ``` """ plotly_plot = tools.mpl_to_plotly(mpl_fig, resize, strip_style, verbose) return iplot(plotly_plot, show_link, link_text, validate, image=image, filename=image_filename, image_height=image_height, image_width=image_width) def enable_mpl_offline(resize=False, strip_style=False, verbose=False, show_link=True, link_text='Export to plot.ly', validate=True): """ Convert mpl plots to locally hosted HTML documents. This function should be used with the inline matplotlib backend that ships with IPython that can be enabled with `%pylab inline` or `%matplotlib inline`. This works by adding an HTML formatter for Figure objects; the existing SVG/PNG formatters will remain enabled. (idea taken from `mpld3._display.enable_notebook`) Example: ``` from plotly.offline import enable_mpl_offline import matplotlib.pyplot as plt enable_mpl_offline() fig = plt.figure() x = [10, 15, 20, 25, 30] y = [100, 250, 200, 150, 300] plt.plot(x, y, "o") fig ``` """ init_notebook_mode() ip = ipython.core.getipython.get_ipython() formatter = ip.display_formatter.formatters['text/html'] formatter.for_type(matplotlib.figure.Figure, lambda fig: iplot_mpl(fig, resize, strip_style, verbose, show_link, link_text, validate)) plotly-2.2.3+dfsg.orig/plotly/offline/__init__.py0000644000175000017500000000032513104403274021323 0ustar noahfxnoahfx""" offline ====== This module provides offline functionality. """ from . offline import ( download_plotlyjs, enable_mpl_offline, init_notebook_mode, iplot, iplot_mpl, plot, plot_mpl ) plotly-2.2.3+dfsg.orig/plotly/optional_imports.py0000644000175000017500000000120213104403274021537 0ustar noahfxnoahfx""" Stand-alone module to provide information about whether optional deps exist. """ from __future__ import absolute_import from importlib import import_module _not_importable = set() def get_module(name): """ Return module or None. Absolute import is required. :param (str) name: Dot-separated module path. E.g., 'scipy.stats'. :raise: (ImportError) Only when exc_msg is defined. :return: (module|None) If import succeeds, the module will be returned. """ if name not in _not_importable: try: return import_module(name) except ImportError: _not_importable.add(name) plotly-2.2.3+dfsg.orig/plotly/graph_reference.py0000644000175000017500000005255513104403274021275 0ustar noahfxnoahfx""" This module handles accessing, storing, and managing the graph reference. """ from __future__ import absolute_import import os import re from pkg_resources import resource_string import six from requests.compat import json as _json from plotly import utils # For backwards compat, we keep this list of previously known objects. # Moving forward, we only add new trace names. # {: {'object_name': , 'base_type': } _BACKWARDS_COMPAT_CLASS_NAMES = { 'AngularAxis': {'object_name': 'angularaxis', 'base_type': dict}, 'Annotation': {'object_name': 'annotation', 'base_type': dict}, 'Annotations': {'object_name': 'annotations', 'base_type': list}, 'Area': {'object_name': 'area', 'base_type': dict}, 'Bar': {'object_name': 'bar', 'base_type': dict}, 'Box': {'object_name': 'box', 'base_type': dict}, 'ColorBar': {'object_name': 'colorbar', 'base_type': dict}, 'Contour': {'object_name': 'contour', 'base_type': dict}, 'Contours': {'object_name': 'contours', 'base_type': dict}, 'Data': {'object_name': 'data', 'base_type': list}, 'ErrorX': {'object_name': 'error_x', 'base_type': dict}, 'ErrorY': {'object_name': 'error_y', 'base_type': dict}, 'ErrorZ': {'object_name': 'error_z', 'base_type': dict}, 'Figure': {'object_name': 'figure', 'base_type': dict}, 'Font': {'object_name': 'font', 'base_type': dict}, 'Frames': {'object_name': 'frames', 'base_type': list}, 'Heatmap': {'object_name': 'heatmap', 'base_type': dict}, 'Histogram': {'object_name': 'histogram', 'base_type': dict}, 'Histogram2d': {'object_name': 'histogram2d', 'base_type': dict}, 'Histogram2dContour': {'object_name': 'histogram2dcontour', 'base_type': dict}, 'Layout': {'object_name': 'layout', 'base_type': dict}, 'Legend': {'object_name': 'legend', 'base_type': dict}, 'Line': {'object_name': 'line', 'base_type': dict}, 'Margin': {'object_name': 'margin', 'base_type': dict}, 'Marker': {'object_name': 'marker', 'base_type': dict}, 'RadialAxis': {'object_name': 'radialaxis', 'base_type': dict}, 'Scatter': {'object_name': 'scatter', 'base_type': dict}, 'Scatter3d': {'object_name': 'scatter3d', 'base_type': dict}, 'Scene': {'object_name': 'scene', 'base_type': dict}, 'Stream': {'object_name': 'stream', 'base_type': dict}, 'Surface': {'object_name': 'surface', 'base_type': dict}, 'Trace': {'object_name': None, 'base_type': dict}, 'XAxis': {'object_name': 'xaxis', 'base_type': dict}, 'XBins': {'object_name': 'xbins', 'base_type': dict}, 'YAxis': {'object_name': 'yaxis', 'base_type': dict}, 'YBins': {'object_name': 'ybins', 'base_type': dict}, 'ZAxis': {'object_name': 'zaxis', 'base_type': dict} } def get_graph_reference(): """ Load graph reference JSON (aka plot-schema) :return: (dict) The graph reference. """ path = os.path.join('package_data', 'default-schema.json') s = resource_string('plotly', path).decode('utf-8') graph_reference = utils.decode_unicode(_json.loads(s)) # TODO: Patch in frames info until it hits streambed. See #659 graph_reference['frames'] = { "items": { "frames_entry": { "baseframe": { "description": "The name of the frame into which this " "frame's properties are merged before " "applying. This is used to unify " "properties and avoid needing to specify " "the same values for the same properties " "in multiple frames.", "role": "info", "valType": "string" }, "data": { "description": "A list of traces this frame modifies. " "The format is identical to the normal " "trace definition.", "role": "object", "valType": "any" }, "group": { "description": "An identifier that specifies the group " "to which the frame belongs, used by " "animate to select a subset of frames.", "role": "info", "valType": "string" }, "layout": { "role": "object", "description": "Layout properties which this frame " "modifies. The format is identical to " "the normal layout definition.", "valType": "any" }, "name": { "description": "A label by which to identify the frame", "role": "info", "valType": "string" }, "role": "object", "traces": { "description": "A list of trace indices that identify " "the respective traces in the data " "attribute", "role": "info", "valType": "info_array" } } }, "role": "object" } return graph_reference def string_to_class_name(string): """ Single function to handle turning object names into class names. GRAPH_REFERENCE has names like `error_y`, which we'll turn into `ErrorY`. :param (str) string: A string that we'll turn into a class name string. :return: (str) """ # capitalize first letter string = re.sub(r'[A-Za-z]', lambda m: m.group().title(), string, count=1) # replace `*_` with `*` E.g., `Error_x` --> `ErrorX` string = re.sub(r'_[A-Za-z0-9]+', lambda m: m.group()[1:].title(), string) return str(string) def object_name_to_class_name(object_name): """Not all objects have classes auto-generated.""" if object_name in TRACE_NAMES: return string_to_class_name(object_name) if object_name in OBJECT_NAME_TO_CLASS_NAME: return OBJECT_NAME_TO_CLASS_NAME[object_name] if object_name in ARRAYS: return 'list' else: return 'dict' def get_attributes_dicts(object_name, parent_object_names=()): """ Returns *all* attribute information given the context of parents. The response has the form: { ('some', 'path'): {}, ('some', 'other', 'path'): {}, ... 'additional_attributes': {} } There may be any number of paths mapping to attribute dicts. There will be one attribute dict under 'additional_attributes' which will usually be empty. :param (str|unicode) object_name: The object name whose attributes we want. :param (list[str|unicode]) parent_object_names: Names of parent objects. :return: (dict) """ object_dict = OBJECTS[object_name] # If we patched this object, we may have added hard-coded attrs. additional_attributes = object_dict['additional_attributes'] # We should also one or more paths where attributes are defined. attribute_paths = list(object_dict['attribute_paths']) # shallow copy # Map frame 'data' and 'layout' to previously-defined figure attributes. # Examples of parent_object_names changes: # ['figure', 'frames'] --> ['figure', 'frames'] # ['figure', 'frames', FRAME_NAME] --> ['figure'] # ['figure', 'frames', FRAME_NAME, 'data'] --> ['figure', 'data'] # ['figure', 'frames', FRAME_NAME, 'layout'] --> ['figure', 'layout'] # ['figure', 'frames', FRAME_NAME, 'foo'] --> # ['figure', 'frames', FRAME_NAME, 'foo'] # [FRAME_NAME, 'layout'] --> ['figure', 'layout'] if FRAME_NAME in parent_object_names: len_parent_object_names = len(parent_object_names) index = parent_object_names.index(FRAME_NAME) if len_parent_object_names == index + 1: if object_name in ('data', 'layout'): parent_object_names = ['figure', object_name] elif len_parent_object_names > index + 1: if parent_object_names[index + 1] in ('data', 'layout'): parent_object_names = ( ['figure'] + list(parent_object_names)[index + 1:] ) # If we have parent_names, some of these attribute paths may be invalid. for parent_object_name in reversed(parent_object_names): if parent_object_name in ARRAYS: continue parent_object_dict = OBJECTS[parent_object_name] parent_attribute_paths = parent_object_dict['attribute_paths'] for path in list(attribute_paths): if not _is_valid_sub_path(path, parent_attribute_paths): attribute_paths.remove(path) # We return a dict mapping paths to attributes. We also add in additional # attributes if defined. attributes_dicts = {path: utils.get_by_path(GRAPH_REFERENCE, path) for path in attribute_paths} attributes_dicts['additional_attributes'] = additional_attributes return attributes_dicts @utils.memoize() def _get_valid_attributes(object_name, parent_object_names): attributes = get_attributes_dicts(object_name, parent_object_names) # These are for documentation and quick lookups. They're just strings. valid_attributes = set() for attributes_dict in attributes.values(): for key, val in attributes_dict.items(): if key not in GRAPH_REFERENCE['defs']['metaKeys']: valid_attributes.add(key) deprecated_attributes = attributes_dict.get('_deprecated', {}) for key, val in deprecated_attributes.items(): if key not in GRAPH_REFERENCE['defs']['metaKeys']: valid_attributes.add(key) return valid_attributes def get_valid_attributes(object_name, parent_object_names=()): # Enforce that parent_object_names is hashable (a tuple). return _get_valid_attributes(object_name, tuple(parent_object_names)) def get_deprecated_attributes(object_name, parent_object_names=()): attributes = get_attributes_dicts(object_name, parent_object_names) # These are for documentation and quick lookups. They're just strings. deprecated_attributes = set() for attributes_dict in attributes.values(): deprecated_attributes_dict = attributes_dict.get('_deprecated', {}) for key, val in deprecated_attributes_dict.items(): if key not in GRAPH_REFERENCE['defs']['metaKeys']: deprecated_attributes.add(key) return deprecated_attributes def get_subplot_attributes(object_name, parent_object_names=()): attributes = get_attributes_dicts(object_name, parent_object_names) # These are for documentation and quick lookups. They're just strings. subplot_attributes = set() for attributes_dict in attributes.values(): for key, val in attributes_dict.items(): if key not in GRAPH_REFERENCE['defs']['metaKeys']: if isinstance(val, dict) and val.get('_isSubplotObj'): subplot_attributes.add(key) deprecated_attributes = attributes_dict.get('_deprecated', {}) for key, val in deprecated_attributes.items(): if key not in GRAPH_REFERENCE['defs']['metaKeys']: if isinstance(val, dict) and val.get('_isSubplotObj'): subplot_attributes.add(key) return subplot_attributes def attribute_path_to_object_names(attribute_container_path): """ Return a location within a figure from a path existing in GRAPH_REFERENCE. Users don't need to know about GRAPH_REFERENCE, so yielding information about paths there would only be confusing. Also, the implementation and structure there may change, but figure structure won't. :param (tuple[str]) attribute_container_path: An object should exist here. :return: (tuple[str]) A tuple of object names: Example: In: ('traces', 'pie', 'attributes', 'marker') Out: ('figure', 'data', 'pie', 'marker') """ object_names = ['figure'] # this is always the case if 'layout' in attribute_container_path: for path_part in attribute_container_path: if path_part in OBJECTS: object_names.append(path_part) if path_part in ARRAYS: object_names.append(path_part) object_names.append(path_part[:-1]) elif 'layoutAttributes' in attribute_container_path: object_names.append('layout') start_index = attribute_container_path.index('layoutAttributes') for path_part in attribute_container_path[start_index:]: if path_part in OBJECTS: object_names.append(path_part) if path_part in ARRAYS: object_names.append(path_part) object_names.append(path_part[:-1]) else: # assume it's in 'traces' object_names.append('data') for path_part in attribute_container_path: if path_part in OBJECTS: object_names.append(path_part) if path_part in ARRAYS: object_names.append(path_part) object_names.append(path_part[:-1]) return tuple(object_names) @utils.memoize() def _get_role(object_name, attribute, value_type, parent_object_names=()): """Private, more easily memoized version of get_role.""" if attribute == 'type' and object_name in TRACE_NAMES: return 'info' attributes_dicts = get_attributes_dicts(object_name, parent_object_names) matches = [] for attributes_dict in attributes_dicts.values(): for key, val in attributes_dict.items(): if key == attribute: matches.append(val) for key, val in attributes_dict.get('_deprecated', {}).items(): if key == attribute: matches.append(val) roles = [] for match in matches: role = match['role'] array_ok = match.get('arrayOk') if array_ok and value_type == 'array': role = 'data' roles.append(role) # TODO: this is ambiguous until the figure is in place... if 'data' in roles: role = 'data' else: role = roles[0] return role def get_role(object_name, attribute, value=None, parent_object_names=()): """ Values have types associated with them based on graph_reference. 'data' type values are always kept 'style' values are kept if they're sequences (but not strings) :param (str) object_name: The name of the object containing 'attribute'. :param (str) attribute: The attribute we want the `role` of. :param (*) value: If the value is an array, the return can be different. :param parent_object_names: An iterable of obj names from graph reference. :returns: (str) This will be 'data', 'style', or 'info'. """ if value is None: value_type = 'none' elif isinstance(value, dict): value_type = 'dict' elif isinstance(value, six.string_types): value_type = 'string' elif hasattr(value, '__iter__'): value_type = 'array' else: value_type = 'unknown' # Enforce that parent_object_names is hashable (a tuple). return _get_role(object_name, attribute, value_type, tuple(parent_object_names)) def _is_valid_sub_path(path, parent_paths): """ Check if a sub path is valid given an iterable of parent paths. :param (tuple[str]) path: The path that may be a sub path. :param (list[tuple]) parent_paths: The known parent paths. :return: (bool) Examples: * ('a', 'b', 'c') is a valid subpath of ('a', ) * ('a', 'd') is not a valid subpath of ('b', ) * ('a', ) is not a valid subpath of ('a', 'b') * ('anything',) is a valid subpath of () """ if not parent_paths: return True for parent_path in parent_paths: if path[:len(parent_path)] == parent_path: return True return False def _get_objects(): """ Create a reorganization of graph reference which organizes by object name. Each object can have *many* different definitions in the graph reference. These possibilities get narrowed down when we have contextual information about parent objects. For instance, Marker in Scatter has a different definition than Marker in Pie. However, we need Marker, Scatter, and Pie to exist on their own as well. Each value has the form: { 'meta_paths': [], 'attribute_paths': [], 'additional_attributes': {} } * meta_paths describes the top-most path where this object is defined * attribute_paths describes all the locations where attributes exist * additional_attributes can be used to hard-code (patch) the plot schema :return: (dict) """ objects = {} for node, path in utils.node_generator(GRAPH_REFERENCE): if any([key in path for key in GRAPH_REFERENCE['defs']['metaKeys']]): continue # objects don't exist under nested meta keys if node.get('role') != 'object': continue if 'items' in node: continue object_name = path[-1] if object_name not in objects: objects[object_name] = {'meta_paths': [], 'attribute_paths': [], 'additional_attributes': {}} if node.get('attributes'): objects[object_name]['attribute_paths'].append( path + ('attributes', ) ) else: objects[object_name]['attribute_paths'].append(path) objects[object_name]['meta_paths'].append(path) return objects def _patch_objects(): """Things like Layout, Figure, and Data need to be included.""" layout_attribute_paths = [] for node, path in utils.node_generator(GRAPH_REFERENCE): if any([key in path for key in GRAPH_REFERENCE['defs']['metaKeys']]): continue # objects don't exist under nested meta keys if path and path[-1] == 'layoutAttributes': layout_attribute_paths.append(path) for trace_name in TRACE_NAMES: OBJECTS[trace_name] = { 'meta_paths': [('traces', trace_name)], 'attribute_paths': [('traces', trace_name, 'attributes')], 'additional_attributes': {} } OBJECTS['layout'] = {'meta_paths': [('layout', )], 'attribute_paths': layout_attribute_paths, 'additional_attributes': {}} figure_attributes = { 'layout': {'role': 'object'}, 'data': {'role': 'object', '_isLinkedToArray': True}, 'frames': {'role': 'object', '_isLinkedToArray': True} } OBJECTS['figure'] = {'meta_paths': [], 'attribute_paths': [], 'additional_attributes': figure_attributes} def _get_arrays(): """Very few arrays, but this dict is the complement of OBJECTS.""" arrays = {} for node, path in utils.node_generator(GRAPH_REFERENCE): if any([key in path for key in GRAPH_REFERENCE['defs']['metaKeys']]): continue # objects don't exist under nested meta keys if node.get('role') != 'object': continue if 'items' not in node: continue object_name = path[-1] if object_name not in arrays: items = node['items'] # If items is a dict, it's anyOf them. if isinstance(items, dict): item_names = list(items.keys()) else: item_names = [object_name[:-1]] arrays[object_name] = {'meta_paths': [path], 'items': item_names} return arrays def _patch_arrays(): """Adds information on our eventual Data array.""" ARRAYS['data'] = {'meta_paths': [('traces', )], 'items': list(TRACE_NAMES)} def _get_classes(): """ We eventually make classes out of the objects in GRAPH_REFERENCE. :return: (dict) A mapping of class names to object names. """ classes = {} # add all the objects we had before, but mark them if they no longer # exist in the graph reference for class_name, class_dict in _BACKWARDS_COMPAT_CLASS_NAMES.items(): object_name = class_dict['object_name'] base_type = class_dict['base_type'] if object_name in OBJECTS or object_name in ARRAYS: classes[class_name] = {'object_name': object_name, 'base_type': base_type} else: classes[class_name] = {'object_name': None, 'base_type': base_type} # always keep the trace dicts up to date for object_name in TRACE_NAMES: class_name = string_to_class_name(object_name) classes[class_name] = {'object_name': object_name, 'base_type': dict} return classes # The ordering here is important. GRAPH_REFERENCE = get_graph_reference() FRAME_NAME = list(GRAPH_REFERENCE['frames']['items'].keys())[0] # See http://blog.labix.org/2008/06/27/watch-out-for-listdictkeys-in-python-3 TRACE_NAMES = list(GRAPH_REFERENCE['traces'].keys()) OBJECTS = _get_objects() _patch_objects() ARRAYS = _get_arrays() _patch_arrays() CLASSES = _get_classes() OBJECT_NAME_TO_CLASS_NAME = {class_dict['object_name']: class_name for class_name, class_dict in CLASSES.items() if class_dict['object_name'] is not None} plotly-2.2.3+dfsg.orig/plotly/graph_objs/0000755000175000017500000000000013211605515017707 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/graph_objs/graph_objs.py0000644000175000017500000021406113200645311022377 0ustar noahfxnoahfx""" graph_objs ========== A module that understands plotly language and can manage the json structures. This module defines two base classes: PlotlyList and PlotlyDict. The former inherits from `list` and the latter inherits from `dict`. and is A third structure, PlotlyTrace, is also considered a base class for all subclassing 'trace' objects like Scatter, Box, Bar, etc. It is also not meant to instantiated by users. Goals of this module: --------------------- * A dict/list with the same entries as a PlotlyDict/PlotlyList should look exactly the same once a call is made to plot. * Only mutate object structure when users ASK for it. (some magic now...) * It should always be possible to get a dict/list JSON representation from a graph_objs object and it should always be possible to make a graph_objs object from a dict/list JSON representation. """ from __future__ import absolute_import import copy import re import warnings from collections import OrderedDict import six from plotly import exceptions, graph_reference from plotly.graph_objs import graph_objs_tools _subplot_regex = re.compile(r'(?P\d+$)') class PlotlyBase(object): """ Base object for PlotlyList and PlotlyDict. """ _name = None _parent = None _parent_key = None def _get_path(self): """ Get a tuple of the str keys and int indices for this object's path. :return: (tuple) """ path = [] parents = self._get_parents() parents.reverse() children = [self] + parents[:-1] for parent, child in zip(parents, children): path.append(child._parent_key) path.reverse() return tuple(path) def _get_parents(self): """ Get a list of all the parent objects above this one. :return: (list[PlotlyBase]) """ parents = [] parent = self._parent while parent is not None: parents.append(parent) parent = parent._parent parents.reverse() return parents def _get_parent_object_names(self): """ Get a list of the names of the parent objects above this one. :return: (list[str]) """ parents = self._get_parents() return [parent._name for parent in parents] def _get_class_name(self): """For convenience. See `graph_reference.object_name_to_class_name`.""" return graph_reference.object_name_to_class_name(self._name) def help(self, return_help=False): """ Print a help string for this object. :param (bool) return_help: Return help string instead of prining? :return: (None|str) Optionally can return help string. """ object_name = self._name path = self._get_path() parent_object_names = self._get_parent_object_names() help_string = graph_objs_tools.get_help(object_name, path, parent_object_names) if return_help: return help_string print(help_string) def to_graph_objs(self, **kwargs): """Everything is cast into graph_objs. Here for backwards compat.""" pass def validate(self): """Everything is *always* validated now. Keep for backwards compat.""" pass class PlotlyList(list, PlotlyBase): """ Base class for list-like Plotly objects. """ _name = None def __init__(self, *args, **kwargs): _raise = kwargs.get('_raise', True) if self._name is None: self.__dict__['_name'] = kwargs.pop('_name', None) self.__dict__['_parent'] = kwargs.get('_parent') self.__dict__['_parent_key'] = kwargs.get('_parent_key') if self._name is None: raise exceptions.PlotlyError( "PlotlyList is a base class. It's shouldn't be instantiated." ) if args and isinstance(args[0], dict): note = ( "Just like a `list`, `{name}` must be instantiated " "with a *single* collection.\n" "In other words these are OK:\n" ">>> {name}()\n" ">>> {name}([])\n" ">>> {name}([dict()])\n" ">>> {name}([dict(), dict()])\n" "However, these don't make sense:\n" ">>> {name}(dict())\n" ">>> {name}(dict(), dict())" .format(name=self._get_class_name()) ) raise exceptions.PlotlyListEntryError(self, [0], notes=[note]) super(PlotlyList, self).__init__() for index, value in enumerate(list(*args)): value = self._value_to_graph_object(index, value, _raise=_raise) if isinstance(value, PlotlyBase): self.append(value) def __setitem__(self, index, value, _raise=True): """Override to enforce validation.""" if not isinstance(index, int): if _raise: index_type = type(index) raise TypeError('Index must be int, not {}'.format(index_type)) return if index >= len(self): raise IndexError(index) value = self._value_to_graph_object(index, value, _raise=_raise) if isinstance(value, (PlotlyDict, PlotlyList)): super(PlotlyList, self).__setitem__(index, value) def __setattr__(self, key, value): raise exceptions.PlotlyError('Setting attributes on a PlotlyList is ' 'not allowed') def __iadd__(self, other): """Defines the `+=` operator, which we map to extend.""" self.extend(other) return self def __copy__(self): # TODO: https://github.com/plotly/python-api/issues/291 return GraphObjectFactory.create(self._name, _parent=self._parent, _parent_key=self._parent_key, *self) def __deepcopy__(self, memodict={}): # TODO: https://github.com/plotly/python-api/issues/291 return self.__copy__() def _value_to_graph_object(self, index, value, _raise=True): """ Attempt to change the given value into a graph object. If _raise is False, this won't raise. If the entry can't be converted, `None` is returned, meaning the caller should ignore the value or discard it as a failed conversion. :param (dict) value: A dict to be converted into a graph object. :param (bool) _raise: If False, ignore bad values instead of raising. :return: (PlotlyBase|None) The graph object or possibly `None`. """ if not isinstance(value, dict): if _raise: path = self._get_path() + (index, ) raise exceptions.PlotlyListEntryError(self, path) else: return items = graph_reference.ARRAYS[self._name]['items'] for i, item in enumerate(items, 1): try: return GraphObjectFactory.create(item, _raise=_raise, _parent=self, _parent_key=index, **value) except exceptions.PlotlyGraphObjectError: if i == len(items) and _raise: raise def append(self, value): """Override to enforce validation.""" index = len(self) # used for error messages value = self._value_to_graph_object(index, value) super(PlotlyList, self).append(value) def extend(self, iterable): """Override to enforce validation.""" for value in iterable: index = len(self) value = self._value_to_graph_object(index, value) super(PlotlyList, self).append(value) def insert(self, index, value): """Override to enforce validation.""" value = self._value_to_graph_object(index, value) super(PlotlyList, self).insert(index, value) def update(self, changes, make_copies=False): """ Update current list with changed_list, which must be iterable. :param (dict|list[dict]) changes: :param (bool) make_copies: Because mutable objects contain references to their values, updating multiple items in a list will cause the items to all reference the same original set of objects. To change this behavior add `make_copies=True` which makes deep copies of the update items and therefore break references. """ if isinstance(changes, dict): changes = [changes] for index in range(len(self)): try: update = changes[index % len(changes)] except ZeroDivisionError: pass else: if make_copies: self[index].update(copy.deepcopy(update)) else: self[index].update(update) def strip_style(self): """Strip style by calling `stip_style` on children items.""" for plotly_dict in self: plotly_dict.strip_style() def get_data(self, flatten=False): """ Returns the JSON for the plot with non-data elements stripped. :param (bool) flatten: {'a': {'b': ''}} --> {'a.b': ''} :returns: (dict|list) Depending on (flat|unflat) """ l = list() for plotly_dict in self: l += [plotly_dict.get_data(flatten=flatten)] del_indicies = [index for index, item in enumerate(self) if len(item) == 0] del_ct = 0 for index in del_indicies: del self[index - del_ct] del_ct += 1 if flatten: d = {} for i, e in enumerate(l): for k, v in e.items(): key = "{0}.{1}".format(i, k) d[key] = v return d else: return l def get_ordered(self, **kwargs): """All children are already validated. Just use get_ordered on them.""" return [child.get_ordered() for child in self] def to_string(self, level=0, indent=4, eol='\n', pretty=True, max_chars=80): """Get formatted string by calling `to_string` on children items.""" if not len(self): return "{name}()".format(name=self._get_class_name()) string = "{name}([{eol}{indent}".format( name=self._get_class_name(), eol=eol, indent=' ' * indent * (level + 1)) for index, entry in enumerate(self): string += entry.to_string(level=level+1, indent=indent, eol=eol, pretty=pretty, max_chars=max_chars) if index < len(self) - 1: string += ",{eol}{indent}".format( eol=eol, indent=' ' * indent * (level + 1)) string += ( "{eol}{indent}])").format(eol=eol, indent=' ' * indent * level) return string def force_clean(self, **kwargs): """Remove empty/None values by calling `force_clean()` on children.""" for entry in self: entry.force_clean() del_indicies = [index for index, item in enumerate(self) if len(item) == 0] del_ct = 0 for index in del_indicies: del self[index - del_ct] del_ct += 1 class PlotlyDict(dict, PlotlyBase): """ Base class for dict-like Plotly objects. """ _name = None _parent_key = None _valid_attributes = None _deprecated_attributes = None _subplot_attributes = None def __init__(self, *args, **kwargs): _raise = kwargs.pop('_raise', True) if self._name is None: self.__dict__['_name'] = kwargs.pop('_name', None) self.__dict__['_parent'] = kwargs.pop('_parent', None) self.__dict__['_parent_key'] = kwargs.pop('_parent_key', None) if self._name is None: raise exceptions.PlotlyError( "PlotlyDict is a base class. It's shouldn't be instantiated." ) super(PlotlyDict, self).__init__() if self._name in graph_reference.TRACE_NAMES: self['type'] = self._name # force key-value pairs to go through validation d = {key: val for key, val in dict(*args, **kwargs).items()} for key, val in d.items(): self.__setitem__(key, val, _raise=_raise) def __dir__(self): """Dynamically return the existing and possible attributes.""" return sorted(list(self._get_valid_attributes())) def __getitem__(self, key): """Calls __missing__ when key is not found. May mutate object.""" if key not in self: self.__missing__(key) return super(PlotlyDict, self).__getitem__(key) def __setattr__(self, key, value): """Maps __setattr__ onto __setitem__""" self.__setitem__(key, value) def __setitem__(self, key, value, _raise=True): """Validates/Converts values which should be Graph Objects.""" if not isinstance(key, six.string_types): if _raise: raise TypeError('Key must be string, not {}'.format(type(key))) return if key.endswith('src'): if key in self._get_valid_attributes(): value = graph_objs_tools.assign_id_to_src(key, value) return super(PlotlyDict, self).__setitem__(key, value) subplot_key = self._get_subplot_key(key) if subplot_key is not None: value = self._value_to_graph_object(subplot_key, value, _raise=_raise) if isinstance(value, (PlotlyDict, PlotlyList)): return super(PlotlyDict, self).__setitem__(key, value) if key not in self._get_valid_attributes(): if key in self._get_deprecated_attributes(): warnings.warn( "Oops! '{attribute}' has been deprecated in " "'{object_name}'\nThis may still work, but you should " "update your code when possible.\n\n" "Run `.help('{attribute}')` for more information." .format(attribute=key, object_name=self._name) ) # this means deprecated attrs get set *as-is*! return super(PlotlyDict, self).__setitem__(key, value) else: if _raise: path = self._get_path() + (key, ) raise exceptions.PlotlyDictKeyError(self, path) return if self._get_attribute_role(key) == 'object': value = self._value_to_graph_object(key, value, _raise=_raise) if not isinstance(value, (PlotlyDict, PlotlyList)): return super(PlotlyDict, self).__setitem__(key, value) def __getattr__(self, key): """Python only calls this when key is missing!""" try: return self.__getitem__(key) except KeyError: raise AttributeError(key) def __copy__(self): # TODO: https://github.com/plotly/python-api/issues/291 return GraphObjectFactory.create(self._name, _parent=self.parent, _parent_key=self._parent_key, **self) def __deepcopy__(self, memodict={}): # TODO: https://github.com/plotly/python-api/issues/291 return self.__copy__() def __missing__(self, key): """Mimics defaultdict. This is called from __getitem__ when key DNE.""" if key in self._get_valid_attributes(): if self._get_attribute_role(key) == 'object': value = GraphObjectFactory.create(key, _parent=self, _parent_key=key) return super(PlotlyDict, self).__setitem__(key, value) subplot_key = self._get_subplot_key(key) if subplot_key is not None: value = GraphObjectFactory.create(subplot_key, _parent=self, _parent_key=key) super(PlotlyDict, self).__setitem__(key, value) def _get_attribute_role(self, key, value=None): """See `graph_reference.get_role`.""" object_name = self._name parent_object_names = self._get_parent_object_names() return graph_reference.get_role( object_name, key, value=value, parent_object_names=parent_object_names ) def _get_valid_attributes(self): """See `graph_reference.get_valid_attributes`.""" if self._valid_attributes is None: parent_object_names = self._get_parent_object_names() valid_attributes = graph_reference.get_valid_attributes( self._name, parent_object_names ) self.__dict__['_valid_attributes'] = valid_attributes return self._valid_attributes def _get_deprecated_attributes(self): """See `graph_reference.get_deprecated_attributes`.""" if self._deprecated_attributes is None: parent_object_names = self._get_parent_object_names() deprecated_attributes = graph_reference.get_deprecated_attributes( self._name, parent_object_names ) self.__dict__['_deprecated_attributes'] = deprecated_attributes return self._deprecated_attributes def _get_subplot_attributes(self): """See `graph_reference.get_subplot_attributes`.""" if self._subplot_attributes is None: parent_object_names = self._get_parent_object_names() subplot_attributes = graph_reference.get_subplot_attributes( self._name, parent_object_names ) self.__dict__['_subplot_attributes'] = subplot_attributes return self._subplot_attributes def _get_subplot_key(self, key): """Some keys can have appended integers, this handles that.""" match = _subplot_regex.search(key) if match: root_key = key[:match.start()] if (root_key in self._get_subplot_attributes() and not match.group('digits').startswith('0')): return root_key def _value_to_graph_object(self, key, value, _raise=True): """ Attempt to convert value to graph object. :param (str|unicode) key: Should be an object_name from GRAPH_REFERENCE :param (dict) value: This will fail if it's not a dict. :param (bool) _raise: Flag to prevent inappropriate erring. :return: (PlotlyList|PlotlyDict|None) `None` if `_raise` and failure. """ if key in graph_reference.ARRAYS: val_types = (list, ) else: val_types = (dict, ) if not isinstance(value, val_types): if _raise: path = self._get_path() + (key, ) raise exceptions.PlotlyDictValueError(self, path) else: return # this can be `None` when `_raise == False` return GraphObjectFactory.create(key, value, _raise=_raise, _parent=self, _parent_key=key) def help(self, attribute=None, return_help=False): """ Print help string for this object or an attribute of this object. :param (str) attribute: A valid attribute string for this object. :param (bool) return_help: Return help_string instead of printing it? :return: (None|str) """ if not attribute: return super(PlotlyDict, self).help(return_help=return_help) object_name = self._name path = self._get_path() parent_object_names = self._get_parent_object_names() help_string = graph_objs_tools.get_help(object_name, path, parent_object_names, attribute) if return_help: return help_string print(help_string) def update(self, dict1=None, **dict2): """ Update current dict with dict1 and then dict2. This recursively updates the structure of the original dictionary-like object with the new entries in the second and third objects. This allows users to update with large, nested structures. Note, because the dict2 packs up all the keyword arguments, you can specify the changes as a list of keyword agruments. Examples: # update with dict obj = Layout(title='my title', xaxis=XAxis(range=[0,1], domain=[0,1])) update_dict = dict(title='new title', xaxis=dict(domain=[0,.8])) obj.update(update_dict) obj {'title': 'new title', 'xaxis': {'range': [0,1], 'domain': [0,.8]}} # update with list of keyword arguments obj = Layout(title='my title', xaxis=XAxis(range=[0,1], domain=[0,1])) obj.update(title='new title', xaxis=dict(domain=[0,.8])) obj {'title': 'new title', 'xaxis': {'range': [0,1], 'domain': [0,.8]}} This 'fully' supports duck-typing in that the call signature is identical, however this differs slightly from the normal update method provided by Python's dictionaries. """ if dict1 is not None: for key, val in list(dict1.items()): if key in self: if isinstance(self[key], (PlotlyDict, PlotlyList)): self[key].update(val) else: self[key] = val else: self[key] = val if len(dict2): for key, val in list(dict2.items()): if key in self: if isinstance(self[key], (PlotlyDict, PlotlyList)): self[key].update(val) else: self[key] = val else: self[key] = val def strip_style(self): """ Recursively strip style from the current representation. All PlotlyDicts and PlotlyLists are guaranteed to survive the stripping process, though they made be left empty. This is allowable. Keys that will be stripped in this process are tagged with `'type': 'style'` in graph_objs_meta.json. Note that a key tagged as style, but with an array as a value may still be considered data. """ keys = list(self.keys()) for key in keys: if isinstance(self[key], (PlotlyDict, PlotlyList)): self[key].strip_style() else: if self._get_attribute_role(key, value=self[key]) == 'style': del self[key] # this is for backwards compat when we updated graph reference. elif self._name == 'layout' and key == 'autosize': del self[key] def get_data(self, flatten=False): """Returns the JSON for the plot with non-data elements stripped.""" d = dict() for key, val in list(self.items()): if isinstance(val, (PlotlyDict, PlotlyList)): sub_data = val.get_data(flatten=flatten) if flatten: for sub_key, sub_val in sub_data.items(): key_string = "{0}.{1}".format(key, sub_key) d[key_string] = sub_val else: d[key] = sub_data else: if self._get_attribute_role(key, value=val) == 'data': d[key] = val # we use the name to help make data frames if self._name in graph_reference.TRACE_NAMES and key == 'name': d[key] = val keys = list(d.keys()) for key in keys: if isinstance(d[key], (dict, list)): if len(d[key]) == 0: del d[key] return d def get_ordered(self, **kwargs): """Return a predictable, OrderedDict version of self.""" keys = sorted(self.keys(), key=graph_objs_tools.sort_keys) ordered = OrderedDict() for key in keys: if isinstance(self[key], PlotlyBase): ordered[key] = self[key].get_ordered() else: ordered[key] = self[key] return ordered def to_string(self, level=0, indent=4, eol='\n', pretty=True, max_chars=80): """ Returns a formatted string showing graph_obj constructors. :param (int) level: The number of indentations to start with. :param (int) indent: The indentation amount. :param (str) eol: The end of line character(s). :param (bool) pretty: Curtail long list output with a '..' ? :param (int) max_chars: The max characters per line. Example: print(obj.to_string()) """ if not len(self): return "{name}()".format(name=self._get_class_name()) string = "{name}(".format(name=self._get_class_name()) if self._name in graph_reference.TRACE_NAMES: keys = [key for key in self.keys() if key != 'type'] else: keys = self.keys() keys = sorted(keys, key=graph_objs_tools.sort_keys) num_keys = len(keys) for index, key in enumerate(keys, 1): string += "{eol}{indent}{key}=".format( eol=eol, indent=' ' * indent * (level+1), key=key) if isinstance(self[key], PlotlyBase): string += self[key].to_string(level=level+1, indent=indent, eol=eol, pretty=pretty, max_chars=max_chars) else: if pretty: # curtail representation if too many chars max_len = (max_chars - indent*(level + 1) - len(key + "=") - len(eol)) if index < num_keys: max_len -= len(',') # remember the comma! if isinstance(self[key], list): s = "[]" for iii, entry in enumerate(self[key], 1): if iii < len(self[key]): s_sub = graph_objs_tools.curtail_val_repr( entry, max_chars=max_len - len(s), add_delim=True ) else: s_sub = graph_objs_tools.curtail_val_repr( entry, max_chars=max_len - len(s), add_delim=False ) s = s[:-1] + s_sub + s[-1] if len(s) == max_len: break string += s else: string += graph_objs_tools.curtail_val_repr( self[key], max_len) else: # they want it all! string += repr(self[key]) if index < num_keys: string += "," string += "{eol}{indent})".format(eol=eol, indent=' ' * indent * level) return string def force_clean(self, **kwargs): """Recursively remove empty/None values.""" keys = list(self.keys()) for key in keys: try: self[key].force_clean() except AttributeError: pass if isinstance(self[key], (dict, list)): if len(self[key]) == 0: del self[key] # clears empty collections! elif self[key] is None: del self[key] class GraphObjectFactory(object): """GraphObject creation in this module should run through this factory.""" @staticmethod def create(object_name, *args, **kwargs): """ Create a graph object from the OBJECTS dict by name, args, and kwargs. :param (str) object_name: A valid object name from OBJECTS. :param args: Arguments to pass to class constructor. :param kwargs: Keyword arguments to pass to class constructor. :return: (PlotlyList|PlotlyDict) The instantiated graph object. """ is_array = object_name in graph_reference.ARRAYS is_object = object_name in graph_reference.OBJECTS if not (is_array or is_object): raise exceptions.PlotlyError( "'{}' is not a valid object name.".format(object_name) ) # We patch Figure and Data, so they actually require the subclass. class_name = graph_reference.OBJECT_NAME_TO_CLASS_NAME.get(object_name) if class_name in ['Figure', 'Data', 'Frames']: return globals()[class_name](*args, **kwargs) else: kwargs['_name'] = object_name if is_array: return PlotlyList(*args, **kwargs) else: return PlotlyDict(*args, **kwargs) # AUTO-GENERATED BELOW. DO NOT EDIT! See makefile. class AngularAxis(PlotlyDict): """ Valid attributes for 'angularaxis' at path [] under parents (): ['domain', 'endpadding', 'range', 'showline', 'showticklabels', 'tickcolor', 'ticklen', 'tickorientation', 'ticksuffix', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'angularaxis' class Annotation(PlotlyDict): """ Valid attributes for 'annotation' at path [] under parents (): ['align', 'arrowcolor', 'arrowhead', 'arrowsize', 'arrowwidth', 'ax', 'axref', 'ay', 'ayref', 'bgcolor', 'bordercolor', 'borderpad', 'borderwidth', 'captureevents', 'clicktoshow', 'font', 'height', 'hoverlabel', 'hovertext', 'opacity', 'ref', 'showarrow', 'standoff', 'text', 'textangle', 'valign', 'visible', 'width', 'x', 'xanchor', 'xclick', 'xref', 'xshift', 'y', 'yanchor', 'yclick', 'yref', 'yshift', 'z'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'annotation' class Annotations(PlotlyList): """ Valid items for 'annotations' at path [] under parents (): ['Annotation'] """ _name = 'annotations' class Area(PlotlyDict): """ Valid attributes for 'area' at path [] under parents (): ['customdata', 'customdatasrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'marker', 'name', 'opacity', 'r', 'rsrc', 'showlegend', 'stream', 't', 'tsrc', 'type', 'uid', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'area' class Bar(PlotlyDict): """ Valid attributes for 'bar' at path [] under parents (): ['bardir', 'base', 'basesrc', 'constraintext', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x', 'error_y', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'insidetextfont', 'legendgroup', 'marker', 'name', 'offset', 'offsetsrc', 'opacity', 'orientation', 'outsidetextfont', 'r', 'rsrc', 'showlegend', 'stream', 't', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'tsrc', 'type', 'uid', 'visible', 'width', 'widthsrc', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'bar' class Box(PlotlyDict): """ Valid attributes for 'box' at path [] under parents (): ['boxmean', 'boxpoints', 'customdata', 'customdatasrc', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'jitter', 'legendgroup', 'line', 'marker', 'name', 'opacity', 'orientation', 'pointpos', 'showlegend', 'stream', 'type', 'uid', 'visible', 'whiskerwidth', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'box' class Candlestick(PlotlyDict): """ Valid attributes for 'candlestick' at path [] under parents (): ['close', 'closesrc', 'customdata', 'customdatasrc', 'decreasing', 'high', 'highsrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'increasing', 'legendgroup', 'line', 'low', 'lowsrc', 'name', 'opacity', 'open', 'opensrc', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'whiskerwidth', 'x', 'xaxis', 'xcalendar', 'xsrc', 'yaxis'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'candlestick' class Carpet(PlotlyDict): """ Valid attributes for 'carpet' at path [] under parents (): ['a', 'a0', 'aaxis', 'asrc', 'b', 'b0', 'baxis', 'bsrc', 'carpet', 'cheaterslope', 'color', 'customdata', 'customdatasrc', 'da', 'db', 'font', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', 'showlegend', 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xsrc', 'y', 'yaxis', 'ysrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'carpet' class Choropleth(PlotlyDict): """ Valid attributes for 'choropleth' at path [] under parents (): ['autocolorscale', 'colorbar', 'colorscale', 'customdata', 'customdatasrc', 'geo', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'locationmode', 'locations', 'locationssrc', 'marker', 'name', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'choropleth' class ColorBar(PlotlyDict): """ Valid attributes for 'colorbar' at path [] under parents (): ['bgcolor', 'bordercolor', 'borderwidth', 'dtick', 'exponentformat', 'len', 'lenmode', 'nticks', 'outlinecolor', 'outlinewidth', 'separatethousands', 'showexponent', 'showticklabels', 'showtickprefix', 'showticksuffix', 'thickness', 'thicknessmode', 'tick0', 'tickangle', 'tickcolor', 'tickfont', 'tickformat', 'ticklen', 'tickmode', 'tickprefix', 'ticks', 'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'titleside', 'x', 'xanchor', 'xpad', 'y', 'yanchor', 'ypad'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'colorbar' class Contour(PlotlyDict): """ Valid attributes for 'contour' at path [] under parents (): ['autocolorscale', 'autocontour', 'colorbar', 'colorscale', 'connectgaps', 'contours', 'customdata', 'customdatasrc', 'dx', 'dy', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'line', 'name', 'ncontours', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'transpose', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'xtype', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc', 'ytype', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'contour' class Contourcarpet(PlotlyDict): """ Valid attributes for 'contourcarpet' at path [] under parents (): ['a', 'a0', 'asrc', 'atype', 'autocolorscale', 'autocontour', 'b', 'b0', 'bsrc', 'btype', 'carpet', 'colorbar', 'colorscale', 'connectgaps', 'contours', 'customdata', 'customdatasrc', 'da', 'db', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'line', 'mode', 'name', 'ncontours', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'transpose', 'type', 'uid', 'visible', 'xaxis', 'yaxis', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'contourcarpet' class Contours(PlotlyDict): """ Valid attributes for 'contours' at path [] under parents (): ['coloring', 'end', 'labelfont', 'labelformat', 'operation', 'showlabels', 'showlines', 'size', 'start', 'type', 'value', 'x', 'y', 'z'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'contours' class Data(PlotlyList): """ Valid items for 'data' at path [] under parents (): ['Area', 'Bar', 'Box', 'Candlestick', 'Carpet', 'Choropleth', 'Contour', 'Contourcarpet', 'Heatmap', 'Heatmapgl', 'Histogram', 'Histogram2d', 'Histogram2dcontour', 'Mesh3d', 'Ohlc', 'Parcoords', 'Pie', 'Pointcloud', 'Sankey', 'Scatter', 'Scatter3d', 'Scattercarpet', 'Scattergeo', 'Scattergl', 'Scattermapbox', 'Scatterternary', 'Surface', 'Table'] """ _name = 'data' def _value_to_graph_object(self, index, value, _raise=True): if not isinstance(value, dict): if _raise: notes = ['Entry should subclass dict.'] path = self._get_path() + (index, ) raise exceptions.PlotlyListEntryError(self, path, notes=notes) else: return item = value.get('type', 'scatter') if item not in graph_reference.ARRAYS['data']['items']: if _raise: path = self._get_path() + (0, ) raise exceptions.PlotlyDataTypeError(self, path) return GraphObjectFactory.create(item, _raise=_raise, _parent=self, _parent_key=index, **value) def get_data(self, flatten=False): """ Returns the JSON for the plot with non-data elements stripped. :param (bool) flatten: {'a': {'b': ''}} --> {'a.b': ''} :returns: (dict|list) Depending on (flat|unflat) """ if flatten: data = [v.get_data(flatten=flatten) for v in self] d = {} taken_names = [] for i, trace in enumerate(data): # we want to give the traces helpful names # however, we need to be sure they're unique too... trace_name = trace.pop('name', 'trace_{0}'.format(i)) if trace_name in taken_names: j = 1 new_trace_name = "{0}_{1}".format(trace_name, j) while new_trace_name in taken_names: new_trace_name = ( "{0}_{1}".format(trace_name, j) ) j += 1 trace_name = new_trace_name taken_names.append(trace_name) # finish up the dot-concatenation for k, v in trace.items(): key = "{0}.{1}".format(trace_name, k) d[key] = v return d else: return super(Data, self).get_data(flatten=flatten) class ErrorX(PlotlyDict): """ Valid attributes for 'error_x' at path [] under parents (): ['array', 'arrayminus', 'arrayminussrc', 'arraysrc', 'color', 'copy_ystyle', 'copy_zstyle', 'opacity', 'symmetric', 'thickness', 'traceref', 'tracerefminus', 'type', 'value', 'valueminus', 'visible', 'width'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'error_x' class ErrorY(PlotlyDict): """ Valid attributes for 'error_y' at path [] under parents (): ['array', 'arrayminus', 'arrayminussrc', 'arraysrc', 'color', 'copy_ystyle', 'copy_zstyle', 'opacity', 'symmetric', 'thickness', 'traceref', 'tracerefminus', 'type', 'value', 'valueminus', 'visible', 'width'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'error_y' class ErrorZ(PlotlyDict): """ Valid attributes for 'error_z' at path [] under parents (): ['array', 'arrayminus', 'arrayminussrc', 'arraysrc', 'color', 'copy_ystyle', 'copy_zstyle', 'opacity', 'symmetric', 'thickness', 'traceref', 'tracerefminus', 'type', 'value', 'valueminus', 'visible', 'width'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'error_z' class Figure(PlotlyDict): """ Valid attributes for 'figure' at path [] under parents (): ['data', 'frames', 'layout'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'figure' def __init__(self, *args, **kwargs): super(Figure, self).__init__(*args, **kwargs) if 'data' not in self: self.data = Data(_parent=self, _parent_key='data') def get_data(self, flatten=False): """ Returns the JSON for the plot with non-data elements stripped. Flattening may increase the utility of the result. :param (bool) flatten: {'a': {'b': ''}} --> {'a.b': ''} :returns: (dict|list) Depending on (flat|unflat) """ return self.data.get_data(flatten=flatten) def to_dataframe(self): """ Create a dataframe with trace names and keys as column names. :return: (DataFrame) """ data = self.get_data(flatten=True) from pandas import DataFrame, Series return DataFrame( dict([(k, Series(v)) for k, v in data.items()])) def print_grid(self): """ Print a visual layout of the figure's axes arrangement. This is only valid for figures that are created with plotly.tools.make_subplots. """ try: grid_str = self.__dict__['_grid_str'] except AttributeError: raise Exception("Use plotly.tools.make_subplots " "to create a subplot grid.") print(grid_str) def append_trace(self, trace, row, col): """ Add a trace to your figure bound to axes at the row, col index. The row, col index is generated from figures created with plotly.tools.make_subplots and can be viewed with Figure.print_grid. :param (dict) trace: The data trace to be bound. :param (int) row: Subplot row index (see Figure.print_grid). :param (int) col: Subplot column index (see Figure.print_grid). Example: # stack two subplots vertically fig = tools.make_subplots(rows=2) This is the format of your plot grid: [ (1,1) x1,y1 ] [ (2,1) x2,y2 ] fig.append_trace(Scatter(x=[1,2,3], y=[2,1,2]), 1, 1) fig.append_trace(Scatter(x=[1,2,3], y=[2,1,2]), 2, 1) """ try: grid_ref = self._grid_ref except AttributeError: raise Exception("In order to use Figure.append_trace, " "you must first use " "plotly.tools.make_subplots " "to create a subplot grid.") if row <= 0: raise Exception("Row value is out of range. " "Note: the starting cell is (1, 1)") if col <= 0: raise Exception("Col value is out of range. " "Note: the starting cell is (1, 1)") try: ref = grid_ref[row-1][col-1] except IndexError: raise Exception("The (row, col) pair sent is out of " "range. Use Figure.print_grid to view the " "subplot grid. ") if 'scene' in ref[0]: trace['scene'] = ref[0] if ref[0] not in self['layout']: raise Exception("Something went wrong. " "The scene object for ({r},{c}) " "subplot cell " "got deleted.".format(r=row, c=col)) else: xaxis_key = "xaxis{ref}".format(ref=ref[0][1:]) yaxis_key = "yaxis{ref}".format(ref=ref[1][1:]) if (xaxis_key not in self['layout'] or yaxis_key not in self['layout']): raise Exception("Something went wrong. " "An axis object for ({r},{c}) subplot " "cell got deleted." .format(r=row, c=col)) trace['xaxis'] = ref[0] trace['yaxis'] = ref[1] self['data'] += [trace] class Font(PlotlyDict): """ Valid attributes for 'font' at path [] under parents (): ['color', 'colorsrc', 'family', 'familysrc', 'size', 'sizesrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'font' class Frames(PlotlyList): """ Valid items for 'frames' at path [] under parents (): ['dict'] """ _name = 'frames' def _value_to_graph_object(self, index, value, _raise=True): if isinstance(value, six.string_types): return value return super(Frames, self)._value_to_graph_object(index, value, _raise=_raise) def to_string(self, level=0, indent=4, eol='\n', pretty=True, max_chars=80): """Get formatted string by calling `to_string` on children items.""" if not len(self): return "{name}()".format(name=self._get_class_name()) string = "{name}([{eol}{indent}".format( name=self._get_class_name(), eol=eol, indent=' ' * indent * (level + 1)) for index, entry in enumerate(self): if isinstance(entry, six.string_types): string += repr(entry) else: string += entry.to_string(level=level+1, indent=indent, eol=eol, pretty=pretty, max_chars=max_chars) if index < len(self) - 1: string += ",{eol}{indent}".format( eol=eol, indent=' ' * indent * (level + 1)) string += ( "{eol}{indent}])").format(eol=eol, indent=' ' * indent * level) return string class Heatmap(PlotlyDict): """ Valid attributes for 'heatmap' at path [] under parents (): ['autocolorscale', 'colorbar', 'colorscale', 'connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'transpose', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xgap', 'xsrc', 'xtype', 'y', 'y0', 'yaxis', 'ycalendar', 'ygap', 'ysrc', 'ytype', 'z', 'zauto', 'zmax', 'zmin', 'zsmooth', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'heatmap' class Heatmapgl(PlotlyDict): """ Valid attributes for 'heatmapgl' at path [] under parents (): ['autocolorscale', 'colorbar', 'colorscale', 'customdata', 'customdatasrc', 'dx', 'dy', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'text', 'textsrc', 'transpose', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xsrc', 'xtype', 'y', 'y0', 'yaxis', 'ysrc', 'ytype', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'heatmapgl' class Histogram(PlotlyDict): """ Valid attributes for 'histogram' at path [] under parents (): ['autobinx', 'autobiny', 'bardir', 'cumulative', 'customdata', 'customdatasrc', 'error_x', 'error_y', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'marker', 'name', 'nbinsx', 'nbinsy', 'opacity', 'orientation', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ysrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'histogram' class Histogram2d(PlotlyDict): """ Valid attributes for 'histogram2d' at path [] under parents (): ['autobinx', 'autobiny', 'autocolorscale', 'colorbar', 'colorscale', 'customdata', 'customdatasrc', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'marker', 'name', 'nbinsx', 'nbinsy', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xgap', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ygap', 'ysrc', 'z', 'zauto', 'zmax', 'zmin', 'zsmooth', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'histogram2d' class Histogram2dContour(PlotlyDict): """ Valid attributes for 'histogram2dcontour' at path [] under parents (): ['autobinx', 'autobiny', 'autocolorscale', 'autocontour', 'colorbar', 'colorscale', 'contours', 'customdata', 'customdatasrc', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'name', 'nbinsx', 'nbinsy', 'ncontours', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ysrc', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'histogram2dcontour' class Histogram2dcontour(PlotlyDict): """ Valid attributes for 'histogram2dcontour' at path [] under parents (): ['autobinx', 'autobiny', 'autocolorscale', 'autocontour', 'colorbar', 'colorscale', 'contours', 'customdata', 'customdatasrc', 'histfunc', 'histnorm', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'name', 'nbinsx', 'nbinsy', 'ncontours', 'opacity', 'reversescale', 'showlegend', 'showscale', 'stream', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbins', 'xcalendar', 'xsrc', 'y', 'yaxis', 'ybins', 'ycalendar', 'ysrc', 'z', 'zauto', 'zmax', 'zmin', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'histogram2dcontour' class Layout(PlotlyDict): """ Valid attributes for 'layout' at path [] under parents (): ['angularaxis', 'annotations', 'autosize', 'bargap', 'bargroupgap', 'barmode', 'barnorm', 'boxgap', 'boxgroupgap', 'boxmode', 'calendar', 'direction', 'dragmode', 'font', 'geo', 'height', 'hiddenlabels', 'hiddenlabelssrc', 'hidesources', 'hoverlabel', 'hovermode', 'images', 'legend', 'mapbox', 'margin', 'orientation', 'paper_bgcolor', 'plot_bgcolor', 'radialaxis', 'scene', 'separators', 'shapes', 'showlegend', 'sliders', 'smith', 'ternary', 'title', 'titlefont', 'updatemenus', 'width', 'xaxis', 'yaxis'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'layout' class Legend(PlotlyDict): """ Valid attributes for 'legend' at path [] under parents (): ['bgcolor', 'bordercolor', 'borderwidth', 'font', 'orientation', 'tracegroupgap', 'traceorder', 'x', 'xanchor', 'y', 'yanchor'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'legend' class Line(PlotlyDict): """ Valid attributes for 'line' at path [] under parents (): ['autocolorscale', 'cauto', 'cmax', 'cmin', 'color', 'colorbar', 'colorscale', 'colorsrc', 'dash', 'outliercolor', 'outlierwidth', 'reversescale', 'shape', 'showscale', 'simplify', 'smoothing', 'width', 'widthsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'line' class Margin(PlotlyDict): """ Valid attributes for 'margin' at path [] under parents (): ['autoexpand', 'b', 'l', 'pad', 'r', 't'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'margin' class Marker(PlotlyDict): """ Valid attributes for 'marker' at path [] under parents (): ['autocolorscale', 'blend', 'border', 'cauto', 'cmax', 'cmin', 'color', 'colorbar', 'colors', 'colorscale', 'colorsrc', 'colorssrc', 'gradient', 'line', 'maxdisplayed', 'opacity', 'opacitysrc', 'outliercolor', 'reversescale', 'showscale', 'size', 'sizemax', 'sizemin', 'sizemode', 'sizeref', 'sizesrc', 'symbol', 'symbolsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'marker' class Mesh3d(PlotlyDict): """ Valid attributes for 'mesh3d' at path [] under parents (): ['alphahull', 'autocolorscale', 'cauto', 'cmax', 'cmin', 'color', 'colorbar', 'colorscale', 'contour', 'customdata', 'customdatasrc', 'delaunayaxis', 'facecolor', 'facecolorsrc', 'flatshading', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'i', 'ids', 'idssrc', 'intensity', 'intensitysrc', 'isrc', 'j', 'jsrc', 'k', 'ksrc', 'legendgroup', 'lighting', 'lightposition', 'name', 'opacity', 'reversescale', 'scene', 'showlegend', 'showscale', 'stream', 'type', 'uid', 'vertexcolor', 'vertexcolorsrc', 'visible', 'x', 'xcalendar', 'xsrc', 'y', 'ycalendar', 'ysrc', 'z', 'zcalendar', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'mesh3d' class Ohlc(PlotlyDict): """ Valid attributes for 'ohlc' at path [] under parents (): ['close', 'closesrc', 'customdata', 'customdatasrc', 'decreasing', 'high', 'highsrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'increasing', 'legendgroup', 'line', 'low', 'lowsrc', 'name', 'opacity', 'open', 'opensrc', 'showlegend', 'stream', 'text', 'textsrc', 'tickwidth', 'type', 'uid', 'visible', 'x', 'xaxis', 'xcalendar', 'xsrc', 'yaxis'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'ohlc' class Parcoords(PlotlyDict): """ Valid attributes for 'parcoords' at path [] under parents (): ['customdata', 'customdatasrc', 'dimensions', 'domain', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'labelfont', 'legendgroup', 'line', 'name', 'opacity', 'rangefont', 'showlegend', 'stream', 'tickfont', 'type', 'uid', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'parcoords' class Pie(PlotlyDict): """ Valid attributes for 'pie' at path [] under parents (): ['customdata', 'customdatasrc', 'direction', 'dlabel', 'domain', 'hole', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'insidetextfont', 'label0', 'labels', 'labelssrc', 'legendgroup', 'marker', 'name', 'opacity', 'outsidetextfont', 'pull', 'pullsrc', 'rotation', 'scalegroup', 'showlegend', 'sort', 'stream', 'text', 'textfont', 'textinfo', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'values', 'valuessrc', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'pie' class Pointcloud(PlotlyDict): """ Valid attributes for 'pointcloud' at path [] under parents (): ['customdata', 'customdatasrc', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'indices', 'indicessrc', 'legendgroup', 'marker', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'xaxis', 'xbounds', 'xboundssrc', 'xsrc', 'xy', 'xysrc', 'y', 'yaxis', 'ybounds', 'yboundssrc', 'ysrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'pointcloud' class RadialAxis(PlotlyDict): """ Valid attributes for 'radialaxis' at path [] under parents (): ['domain', 'endpadding', 'orientation', 'range', 'showline', 'showticklabels', 'tickcolor', 'ticklen', 'tickorientation', 'ticksuffix', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'radialaxis' class Sankey(PlotlyDict): """ Valid attributes for 'sankey' at path [] under parents (): ['arrangement', 'customdata', 'customdatasrc', 'domain', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'link', 'name', 'node', 'opacity', 'orientation', 'showlegend', 'stream', 'textfont', 'type', 'uid', 'valueformat', 'valuesuffix', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'sankey' class Scatter(PlotlyDict): """ Valid attributes for 'scatter' at path [] under parents (): ['cliponaxis', 'connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x', 'error_y', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hoveron', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity', 'r', 'rsrc', 'showlegend', 'stream', 't', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'tsrc', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scatter' class Scatter3d(PlotlyDict): """ Valid attributes for 'scatter3d' at path [] under parents (): ['connectgaps', 'customdata', 'customdatasrc', 'error_x', 'error_y', 'error_z', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity', 'projection', 'scene', 'showlegend', 'stream', 'surfaceaxis', 'surfacecolor', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible', 'x', 'xcalendar', 'xsrc', 'y', 'ycalendar', 'ysrc', 'z', 'zcalendar', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scatter3d' class Scattercarpet(PlotlyDict): """ Valid attributes for 'scattercarpet' at path [] under parents (): ['a', 'asrc', 'b', 'bsrc', 'carpet', 'connectgaps', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hoveron', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible', 'xaxis', 'yaxis'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scattercarpet' class Scattergeo(PlotlyDict): """ Valid attributes for 'scattergeo' at path [] under parents (): ['connectgaps', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'geo', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'lat', 'latsrc', 'legendgroup', 'line', 'locationmode', 'locations', 'locationssrc', 'lon', 'lonsrc', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scattergeo' class Scattergl(PlotlyDict): """ Valid attributes for 'scattergl' at path [] under parents (): ['connectgaps', 'customdata', 'customdatasrc', 'dx', 'dy', 'error_x', 'error_y', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'x0', 'xaxis', 'xcalendar', 'xsrc', 'y', 'y0', 'yaxis', 'ycalendar', 'ysrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scattergl' class Scattermapbox(PlotlyDict): """ Valid attributes for 'scattermapbox' at path [] under parents (): ['connectgaps', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'lat', 'latsrc', 'legendgroup', 'line', 'lon', 'lonsrc', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'subplot', 'text', 'textfont', 'textposition', 'textsrc', 'type', 'uid', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scattermapbox' class Scatterternary(PlotlyDict): """ Valid attributes for 'scatterternary' at path [] under parents (): ['a', 'asrc', 'b', 'bsrc', 'c', 'cliponaxis', 'connectgaps', 'csrc', 'customdata', 'customdatasrc', 'fill', 'fillcolor', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'hoveron', 'hovertext', 'hovertextsrc', 'ids', 'idssrc', 'legendgroup', 'line', 'marker', 'mode', 'name', 'opacity', 'showlegend', 'stream', 'subplot', 'sum', 'text', 'textfont', 'textposition', 'textpositionsrc', 'textsrc', 'type', 'uid', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scatterternary' class Scene(PlotlyDict): """ Valid attributes for 'scene' at path [] under parents (): ['annotations', 'aspectmode', 'aspectratio', 'bgcolor', 'camera', 'cameraposition', 'domain', 'dragmode', 'hovermode', 'xaxis', 'yaxis', 'zaxis'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'scene' class Stream(PlotlyDict): """ Valid attributes for 'stream' at path [] under parents (): ['maxpoints', 'token'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'stream' class Surface(PlotlyDict): """ Valid attributes for 'surface' at path [] under parents (): ['autocolorscale', 'cauto', 'cmax', 'cmin', 'colorbar', 'colorscale', 'contours', 'customdata', 'customdatasrc', 'hidesurface', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'lighting', 'lightposition', 'name', 'opacity', 'reversescale', 'scene', 'showlegend', 'showscale', 'stream', 'surfacecolor', 'surfacecolorsrc', 'text', 'textsrc', 'type', 'uid', 'visible', 'x', 'xcalendar', 'xsrc', 'y', 'ycalendar', 'ysrc', 'z', 'zauto', 'zcalendar', 'zmax', 'zmin', 'zsrc'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'surface' class Table(PlotlyDict): """ Valid attributes for 'table' at path [] under parents (): ['cells', 'columnorder', 'columnordersrc', 'columnwidth', 'columnwidthsrc', 'customdata', 'customdatasrc', 'domain', 'header', 'hoverinfo', 'hoverinfosrc', 'hoverlabel', 'ids', 'idssrc', 'legendgroup', 'name', 'opacity', 'showlegend', 'stream', 'type', 'uid', 'visible'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'table' class Trace(dict): pass class XAxis(PlotlyDict): """ Valid attributes for 'xaxis' at path [] under parents (): ['anchor', 'autorange', 'autotick', 'backgroundcolor', 'calendar', 'categoryarray', 'categoryarraysrc', 'categoryorder', 'color', 'constrain', 'constraintoward', 'domain', 'dtick', 'exponentformat', 'fixedrange', 'gridcolor', 'gridwidth', 'hoverformat', 'layer', 'linecolor', 'linewidth', 'mirror', 'nticks', 'overlaying', 'position', 'range', 'rangemode', 'rangeselector', 'rangeslider', 'scaleanchor', 'scaleratio', 'separatethousands', 'showaxeslabels', 'showbackground', 'showexponent', 'showgrid', 'showline', 'showspikes', 'showticklabels', 'showtickprefix', 'showticksuffix', 'side', 'spikecolor', 'spikedash', 'spikemode', 'spikesides', 'spikethickness', 'tick0', 'tickangle', 'tickcolor', 'tickfont', 'tickformat', 'ticklen', 'tickmode', 'tickprefix', 'ticks', 'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'type', 'visible', 'zeroline', 'zerolinecolor', 'zerolinewidth'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'xaxis' class XBins(PlotlyDict): """ Valid attributes for 'xbins' at path [] under parents (): ['end', 'size', 'start'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'xbins' class YAxis(PlotlyDict): """ Valid attributes for 'yaxis' at path [] under parents (): ['anchor', 'autorange', 'autotick', 'backgroundcolor', 'calendar', 'categoryarray', 'categoryarraysrc', 'categoryorder', 'color', 'constrain', 'constraintoward', 'domain', 'dtick', 'exponentformat', 'fixedrange', 'gridcolor', 'gridwidth', 'hoverformat', 'layer', 'linecolor', 'linewidth', 'mirror', 'nticks', 'overlaying', 'position', 'range', 'rangemode', 'scaleanchor', 'scaleratio', 'separatethousands', 'showaxeslabels', 'showbackground', 'showexponent', 'showgrid', 'showline', 'showspikes', 'showticklabels', 'showtickprefix', 'showticksuffix', 'side', 'spikecolor', 'spikedash', 'spikemode', 'spikesides', 'spikethickness', 'tick0', 'tickangle', 'tickcolor', 'tickfont', 'tickformat', 'ticklen', 'tickmode', 'tickprefix', 'ticks', 'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'type', 'visible', 'zeroline', 'zerolinecolor', 'zerolinewidth'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'yaxis' class YBins(PlotlyDict): """ Valid attributes for 'ybins' at path [] under parents (): ['end', 'size', 'start'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'ybins' class ZAxis(PlotlyDict): """ Valid attributes for 'zaxis' at path [] under parents (): ['autorange', 'backgroundcolor', 'calendar', 'categoryarray', 'categoryarraysrc', 'categoryorder', 'color', 'dtick', 'exponentformat', 'gridcolor', 'gridwidth', 'hoverformat', 'linecolor', 'linewidth', 'mirror', 'nticks', 'range', 'rangemode', 'separatethousands', 'showaxeslabels', 'showbackground', 'showexponent', 'showgrid', 'showline', 'showspikes', 'showticklabels', 'showtickprefix', 'showticksuffix', 'spikecolor', 'spikesides', 'spikethickness', 'tick0', 'tickangle', 'tickcolor', 'tickfont', 'tickformat', 'ticklen', 'tickmode', 'tickprefix', 'ticks', 'ticksuffix', 'ticktext', 'ticktextsrc', 'tickvals', 'tickvalssrc', 'tickwidth', 'title', 'titlefont', 'type', 'visible', 'zeroline', 'zerolinecolor', 'zerolinewidth'] Run `.help('attribute')` on any of the above. '' is the object at [] """ _name = 'zaxis' __all__ = [cls for cls in graph_reference.CLASSES.keys() if cls in globals()] plotly-2.2.3+dfsg.orig/plotly/graph_objs/graph_objs_tools.py0000644000175000017500000002265613104403274023631 0ustar noahfxnoahfxfrom __future__ import absolute_import import textwrap import six from plotly import exceptions, graph_reference # Define line and tab size for help text! LINE_SIZE = 76 TAB_SIZE = 4 def get_help(object_name, path=(), parent_object_names=(), attribute=None): """ Returns a help string for a graph object. :param (str) object_name: An object name from GRAPH_REFERENCE :param (tuple[str]) path: The path within a `figure` object. :param parent_object_names: An iterable of names of this object's parents. :param (str|None) attribute: An attribute of given . :return: (str) A printable string to show to users. """ if object_name in graph_reference.ARRAYS: help_string = _list_help(object_name, path, parent_object_names) else: if attribute: help_string = _dict_attribute_help(object_name, path, parent_object_names, attribute) else: help_string = _dict_object_help(object_name, path, parent_object_names) return help_string.expandtabs(TAB_SIZE) def _list_help(object_name, path=(), parent_object_names=()): """See get_help().""" items = graph_reference.ARRAYS[object_name]['items'] items_classes = set() for item in items: if item in graph_reference.OBJECT_NAME_TO_CLASS_NAME: items_classes.add(graph_reference.string_to_class_name(item)) else: # There are no lists objects which can contain list entries. items_classes.add('dict') items_classes = list(items_classes) items_classes.sort() lines = textwrap.wrap(repr(items_classes), width=LINE_SIZE-TAB_SIZE-1) help_dict = { 'object_name': object_name, 'path_string': '[' + ']['.join(repr(k) for k in path) + ']', 'parent_object_names': parent_object_names, 'items_string': '\t' + '\n\t'.join(lines) } return ( "Valid items for '{object_name}' at path {path_string} under parents " "{parent_object_names}:\n{items_string}\n".format(**help_dict) ) def _dict_object_help(object_name, path, parent_object_names): """See get_help().""" attributes = list( graph_reference.get_valid_attributes(object_name, parent_object_names)) attributes.sort() lines = textwrap.wrap(repr(list(attributes)), width=LINE_SIZE-TAB_SIZE-1) help_dict = { 'object_name': object_name, 'path_string': '[' + ']['.join(repr(k) for k in path) + ']', 'parent_object_names': parent_object_names, 'attributes_string': '\t' + '\n\t'.join(lines) } return ( "Valid attributes for '{object_name}' at path {path_string} under " "parents {parent_object_names}:\n\n{attributes_string}\n\n" "Run `<{object_name}-object>.help('attribute')` on any of the above.\n" "'<{object_name}-object>' is the object at {path_string}" .format(**help_dict) ) def _dict_attribute_help(object_name, path, parent_object_names, attribute): """ Get general help information or information on a specific attribute. See get_help(). :param (str|unicode) attribute: The attribute we'll get info for. """ help_dict = { 'object_name': object_name, 'path_string': '[' + ']['.join(repr(k) for k in path) + ']', 'parent_object_names': parent_object_names, 'attribute': attribute } valid_attributes = graph_reference.get_valid_attributes( object_name, parent_object_names ) help_string = ( "Current path: {path_string}\n" "Current parent object_names: {parent_object_names}\n\n") if attribute not in valid_attributes: help_string += "'{attribute}' is not allowed here.\n" return help_string.format(**help_dict) attributes_dicts = graph_reference.get_attributes_dicts( object_name, parent_object_names ) attribute_definitions = [] additional_definition = None meta_keys = graph_reference.GRAPH_REFERENCE['defs']['metaKeys'] trace_names = graph_reference.TRACE_NAMES for key, attribute_dict in attributes_dicts.items(): if attribute in attribute_dict: if object_name in trace_names and attribute == 'type': d = {'role': 'info'} else: d = {k: v for k, v in attribute_dict[attribute].items() if k in meta_keys and not k.startswith('_')} elif attribute in attribute_dict.get('_deprecated', {}): deprecate_attribute_dict = attribute_dict['_deprecated'][attribute] d = {k: v for k, v in deprecate_attribute_dict.items() if k in meta_keys and not k.startswith('_')} d['deprecated'] = True else: continue if key == 'additional_attributes': additional_definition = d continue new_definition = True for item in attribute_definitions: if item['definition'] == d: item['paths'].append(key) new_definition = False if new_definition: attribute_definitions.append({'paths': [key], 'definition': d}) if attribute_definitions: help_string += ("With the current parents, '{attribute}' can be " "used as follows:\n\n") help_string = help_string.format(**help_dict) for item in attribute_definitions: valid_parents_objects_names = [ graph_reference.attribute_path_to_object_names(definition_path) for definition_path in item['paths'] ] if len(valid_parents_objects_names) == 1: valid_parent_objects_names = valid_parents_objects_names[0] help_string += 'Under {}:\n\n'.format( str(valid_parent_objects_names) ) else: help_string += 'Under any of:\n\t\t* {}\n\n'.format( '\n\t\t* '.join(str(tup) for tup in valid_parents_objects_names) ) for meta_key, val in sorted(item['definition'].items()): help_string += '\t{}: '.format(meta_key) if meta_key == 'description': # TODO: https://github.com/plotly/streambed/issues/3950 if isinstance(val, list) and attribute == 'showline': val = val[0] lines = textwrap.wrap(val, width=LINE_SIZE-1) help_string += '\n\t\t'.join(lines) else: help_string += '{}'.format(val) help_string += '\n' help_string += '\n\n' if additional_definition: help_string += 'Additionally:\n\n' for item in sorted(additional_definition.items()): help_string += '\t{}: {}\n'.format(*item) help_string += '\n' return help_string def curtail_val_repr(val, max_chars, add_delim=False): """ Used mostly by the `to_string` function on Graph Objects to pretty print. Limit the number of characters of output, but keep the representation pretty. :param (*) val: The `repr(val)` result is what gets curtailed. :param (int) max_chars: Max number of chars which may be returned. :param (bool) add_delim: Used if a value is *not* the last in an iterable. :return: (str) """ delim = ", " end = ".." if isinstance(val, six.string_types): if max_chars <= len("'" + end + "'"): return ' ' * max_chars elif add_delim and max_chars <= len("'" + end + "'") + len(delim): return "'" + end + "'" + ' ' * (max_chars - len("'" + end + "'")) else: if max_chars <= len(end): return ' ' * max_chars elif add_delim and max_chars <= len(end) + len(delim): return end + ' ' * (max_chars - len(end)) if add_delim: max_chars -= len(delim) r = repr(val) if len(r) > max_chars: if isinstance(val, six.string_types): # TODO: can we assume this ends in "'" r = r[:max_chars - len(end + "'")] + end + "'" elif (isinstance(val, list) and max_chars >= len("[{end}]".format(end=end))): r = r[:max_chars - len(end + ']')] + end + ']' else: r = r[:max_chars - len(end)] + end if add_delim: r += delim return r def assign_id_to_src(src_name, src_value): if isinstance(src_value, six.string_types): src_id = src_value else: try: src_id = src_value.id except: err = ("{0} does not have an `id` property. " "{1} needs to be assigned to either an " "object with an `id` (like a " "plotly.grid_objs.Column) or a string. " "The `id` is a unique identifier " "assigned by the Plotly webserver " "to this grid column.") src_value_str = str(src_value) err = err.format(src_name, src_value_str) raise exceptions.InputError(err) if src_id == '': err = exceptions.COLUMN_NOT_YET_UPLOADED_MESSAGE err.format(column_name=src_value.name, reference=src_name) raise exceptions.InputError(err) return src_id def sort_keys(key): """ Temporary function. See https://github.com/plotly/python-api/issues/290. :param (str|unicode) key: The attribute we're sorting on. :return: (bool, str|unicode) The naturally-sortable tuple. """ is_special = key in 'rtxyz' return not is_special, key plotly-2.2.3+dfsg.orig/plotly/graph_objs/__init__.py0000644000175000017500000000062313104403274022020 0ustar noahfxnoahfx""" graph_objs ========== This package imports definitions for all of Plotly's graph objects. For more information, run help(Obj) on any of the following objects defined here. The reason for the package graph_objs and the module graph_objs is to provide a clearer API for users. """ from __future__ import absolute_import from plotly.graph_objs.graph_objs import * # this is protected with __all__ plotly-2.2.3+dfsg.orig/plotly/files.py0000644000175000017500000000302713104403274017246 0ustar noahfxnoahfximport os # file structure PLOTLY_DIR = os.path.join(os.path.expanduser("~"), ".plotly") CREDENTIALS_FILE = os.path.join(PLOTLY_DIR, ".credentials") CONFIG_FILE = os.path.join(PLOTLY_DIR, ".config") TEST_DIR = os.path.join(os.path.expanduser("~"), ".test") TEST_FILE = os.path.join(PLOTLY_DIR, ".permission_test") # this sets both the DEFAULTS and the TYPES for these files FILE_CONTENT = {CREDENTIALS_FILE: {'username': '', 'api_key': '', 'proxy_username': '', 'proxy_password': '', 'stream_ids': []}, CONFIG_FILE: {'plotly_domain': 'https://plot.ly', 'plotly_streaming_domain': 'stream.plot.ly', 'plotly_api_domain': 'https://api.plot.ly', 'plotly_ssl_verification': True, 'plotly_proxy_authorization': False, 'world_readable': True, 'sharing': 'public', 'auto_open': True}} def _permissions(): try: os.mkdir(TEST_DIR) os.rmdir(TEST_DIR) if not os.path.exists(PLOTLY_DIR): os.mkdir(PLOTLY_DIR) with open(TEST_FILE, 'w') as f: f.write('testing\n') os.remove(TEST_FILE) return True except: return False _file_permissions = _permissions() def check_file_permissions(): return _file_permissions plotly-2.2.3+dfsg.orig/plotly/__init__.py0000644000175000017500000000147113104403274017704 0ustar noahfxnoahfx""" https://plot.ly/python/ Plotly's Python API allows users to programmatically access Plotly's server resources. This package is organized as follows: Subpackages: - plotly: all functionality that requires access to Plotly's servers - graph_objs: objects for designing figures and visualizing data - matplotlylib: tools to convert matplotlib figures Modules: - tools: some helpful tools that do not require access to Plotly's servers - utils: functions that you probably won't need, but that subpackages use - version: holds the current API version - exceptions: defines our custom exception classes """ from __future__ import absolute_import from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools, utils, session, offline, colors) from plotly.version import __version__ plotly-2.2.3+dfsg.orig/plotly/package_data/0000755000175000017500000000000013232502044020151 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/package_data/default-schema.json0000644000175000017500000722663413200645310023751 0ustar noahfxnoahfx{ "animation": { "direction": { "description": "The direction in which to play the frames triggered by the animation call", "dflt": "forward", "role": "info", "valType": "enumerated", "values": [ "forward", "reverse" ] }, "frame": { "duration": { "description": "The duration in milliseconds of each frame. If greater than the frame duration, it will be limited to the frame duration.", "dflt": 500, "min": 0, "role": "info", "valType": "number" }, "redraw": { "description": "Redraw the plot at completion of the transition. This is desirable for transitions that include properties that cannot be transitioned, but may significantly slow down updates that do not require a full redraw of the plot", "dflt": true, "role": "info", "valType": "boolean" }, "role": "object" }, "fromcurrent": { "description": "Play frames starting at the current frame instead of the beginning.", "dflt": false, "role": "info", "valType": "boolean" }, "mode": { "description": "Describes how a new animate call interacts with currently-running animations. If `immediate`, current animations are interrupted and the new animation is started. If `next`, the current frame is allowed to complete, after which the new animation is started. If `afterall` all existing frames are animated to completion before the new animation is started.", "dflt": "afterall", "role": "info", "valType": "enumerated", "values": [ "immediate", "next", "afterall" ] }, "transition": { "duration": { "description": "The duration of the transition, in milliseconds. If equal to zero, updates are synchronous.", "dflt": 500, "min": 0, "role": "info", "valType": "number" }, "easing": { "description": "The easing function used for the transition", "dflt": "cubic-in-out", "role": "info", "valType": "enumerated", "values": [ "linear", "quad", "cubic", "sin", "exp", "circle", "elastic", "back", "bounce", "linear-in", "quad-in", "cubic-in", "sin-in", "exp-in", "circle-in", "elastic-in", "back-in", "bounce-in", "linear-out", "quad-out", "cubic-out", "sin-out", "exp-out", "circle-out", "elastic-out", "back-out", "bounce-out", "linear-in-out", "quad-in-out", "cubic-in-out", "sin-in-out", "exp-in-out", "circle-in-out", "elastic-in-out", "back-in-out", "bounce-in-out" ] }, "role": "object" } }, "defs": { "editType": { "layout": { "description": "layout attributes should include an `editType` string matching this flaglist. *calc* is the most extensive: a full `Plotly.plot` starting by clearing `gd.calcdata` to force it to be regenerated *calcIfAutorange* does a full `Plotly.plot`, but only clears and redoes `gd.calcdata` if there is at least one autoranged axis. *plot* calls `Plotly.plot` but without first clearing `gd.calcdata`. *legend* only redraws the legend. *ticks* only redraws axis ticks, labels, and gridlines. *layoutstyle* reapplies global and SVG cartesian axis styles. *modebar* just updates the modebar. *camera* just updates the camera settings for gl3d scenes. *arraydraw* allows component arrays to invoke the redraw routines just for the component(s) that changed.", "extras": [ "none" ], "flags": [ "calc", "calcIfAutorange", "plot", "legend", "ticks", "layoutstyle", "modebar", "camera", "arraydraw" ], "valType": "flaglist" }, "traces": { "description": "trace attributes should include an `editType` string matching this flaglist. *calc* is the most extensive: a full `Plotly.plot` starting by clearing `gd.calcdata` to force it to be regenerated *calcIfAutorange* does a full `Plotly.plot`, but only clears and redoes `gd.calcdata` if there is at least one autoranged axis. *clearAxisTypes* resets the types of the axes this trace is on, because new data could cause the automatic axis type detection to change. Log type will not be cleared, as that is never automatically chosen so must have been user-specified. *plot* calls `Plotly.plot` but without first clearing `gd.calcdata`. *style* only calls `module.style` for all trace modules and redraws the legend. *colorbars* only redraws colorbars.", "extras": [ "none" ], "flags": [ "calc", "calcIfAutorange", "clearAxisTypes", "plot", "style", "colorbars" ], "valType": "flaglist" } }, "impliedEdits": { "description": "Sometimes when an attribute is changed, other attributes must be altered as well in order to achieve the intended result. For example, when `range` is specified, it is important to set `autorange` to `false` or the new `range` value would be lost in the redraw. `impliedEdits` is the mechanism to do this: `impliedEdits: {autorange: false}`. Each key is a relative paths to the attribute string to change, using *^* to ascend into the parent container, for example `range[0]` has `impliedEdits: {*^autorange*: false}`. A value of `undefined` means that the attribute will not be changed, but its previous value should be recorded in case we want to reverse this change later. For example, `autorange` has `impliedEdits: {*range[0]*: undefined, *range[1]*:undefined} because the range will likely be changed by redraw." }, "metaKeys": [ "_isSubplotObj", "_isLinkedToArray", "_arrayAttrRegexps", "_deprecated", "description", "role", "editType", "impliedEdits" ], "valObjects": { "angle": { "description": "A number (in degree) between -180 and 180.", "otherOpts": [ "dflt" ], "requiredOpts": [] }, "any": { "description": "Any type.", "otherOpts": [ "dflt", "values", "arrayOk" ], "requiredOpts": [] }, "boolean": { "description": "A boolean (true/false) value.", "otherOpts": [ "dflt" ], "requiredOpts": [] }, "color": { "description": "A string describing color. Supported formats: - hex (e.g. '#d3d3d3') - rgb (e.g. 'rgb(255, 0, 0)') - rgba (e.g. 'rgb(255, 0, 0, 0.5)') - hsl (e.g. 'hsl(0, 100%, 50%)') - hsv (e.g. 'hsv(0, 100%, 100%)') - named colors (full list: http://www.w3.org/TR/css3-color/#svg-color)", "otherOpts": [ "dflt", "arrayOk" ], "requiredOpts": [] }, "colorscale": { "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" ], "requiredOpts": [] }, "data_array": { "description": "An {array} of data. The value MUST be an {array}, or we ignore it.", "otherOpts": [ "dflt" ], "requiredOpts": [] }, "enumerated": { "description": "Enumerated value type. The available values are listed in `values`.", "otherOpts": [ "dflt", "coerceNumber", "arrayOk" ], "requiredOpts": [ "values" ] }, "flaglist": { "description": "A string representing a combination of flags (order does not matter here). Combine any of the available `flags` with *+*. (e.g. ('lines+markers')). Values in `extras` cannot be combined.", "otherOpts": [ "dflt", "extras", "arrayOk" ], "requiredOpts": [ "flags" ] }, "info_array": { "description": "An {array} of plot information.", "otherOpts": [ "dflt", "freeLength" ], "requiredOpts": [ "items" ] }, "integer": { "description": "An integer or an integer inside a string. When applicable, values greater (less) than `max` (`min`) are coerced to the `dflt`.", "otherOpts": [ "dflt", "min", "max", "arrayOk" ], "requiredOpts": [] }, "number": { "description": "A number or a numeric value (e.g. a number inside a string). When applicable, values greater (less) than `max` (`min`) are coerced to the `dflt`.", "otherOpts": [ "dflt", "min", "max", "arrayOk" ], "requiredOpts": [] }, "string": { "description": "A string value. Numbers are converted to strings except for attributes with `strict` set to true.", "otherOpts": [ "dflt", "noBlank", "strict", "arrayOk", "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": [], "requiredOpts": [ "dflt" ] } } }, "frames": { "items": { "frames_entry": { "baseframe": { "description": "The name of the frame into which this frame's properties are merged before applying. This is used to unify properties and avoid needing to specify the same values for the same properties in multiple frames.", "role": "info", "valType": "string" }, "data": { "description": "A list of traces this frame modifies. The format is identical to the normal trace definition.", "role": "object", "valType": "any" }, "group": { "description": "An identifier that specifies the group to which the frame belongs, used by animate to select a subset of frames.", "role": "info", "valType": "string" }, "layout": { "description": "Layout properties which this frame modifies. The format is identical to the normal layout definition.", "role": "object", "valType": "any" }, "name": { "description": "A label by which to identify the frame", "role": "info", "valType": "string" }, "role": "object", "traces": { "description": "A list of trace indices that identify the respective traces in the data attribute", "role": "info", "valType": "any" } } }, "role": "object" }, "layout": { "layoutAttributes": { "angularaxis": { "domain": { "description": "Polar chart subplots are not supported yet. This key has currently no effect.", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "editType": "plot", "endpadding": { "editType": "plot", "role": "style", "valType": "number" }, "range": { "description": "Defines the start and end point of this angular axis.", "editType": "plot", "items": [ { "dflt": 0, "editType": "plot", "valType": "number" }, { "dflt": 360, "editType": "plot", "valType": "number" } ], "role": "info", "valType": "info_array" }, "role": "object", "showline": { "description": "Determines whether or not the line bounding this angular axis will be shown on the figure.", "editType": "plot", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the angular axis ticks will feature tick labels.", "editType": "plot", "role": "style", "valType": "boolean" }, "tickcolor": { "description": "Sets the color of the tick lines on this angular axis.", "editType": "plot", "role": "style", "valType": "color" }, "ticklen": { "description": "Sets the length of the tick lines on this angular axis.", "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "tickorientation": { "description": "Sets the orientation (from the paper perspective) of the angular axis tick labels.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "horizontal", "vertical" ] }, "ticksuffix": { "description": "Sets the length of the tick lines on this angular axis.", "editType": "plot", "role": "style", "valType": "string" }, "visible": { "description": "Determines whether or not this axis will be visible.", "editType": "plot", "role": "info", "valType": "boolean" } }, "annotations": { "items": { "annotation": { "_deprecated": { "ref": { "description": "Obsolete. Set `xref` and `yref` separately instead.", "editType": "calc", "role": "info", "valType": "string" } }, "align": { "description": "Sets the horizontal alignment of the `text` within the box. Has an effect only if `text` spans more two or more lines (i.e. `text` contains one or more
HTML tags) or if an explicit width is set to override the text width.", "dflt": "center", "editType": "arraydraw", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "arrowcolor": { "description": "Sets the color of the annotation arrow.", "editType": "arraydraw", "role": "style", "valType": "color" }, "arrowhead": { "description": "Sets the annotation arrow head style.", "dflt": 1, "editType": "arraydraw", "max": 8, "min": 0, "role": "style", "valType": "integer" }, "arrowsize": { "description": "Sets the size of the annotation arrow head, relative to `arrowwidth`. A value of 1 (default) gives a head about 3x as wide as the line.", "dflt": 1, "editType": "calcIfAutorange", "min": 0.3, "role": "style", "valType": "number" }, "arrowwidth": { "description": "Sets the width (in px) of annotation arrow line.", "editType": "calcIfAutorange", "min": 0.1, "role": "style", "valType": "number" }, "ax": { "description": "Sets the x component of the arrow tail about the arrow head. If `axref` is `pixel`, a positive (negative) component corresponds to an arrow pointing from right to left (left to right). If `axref` is an axis, this is an absolute value on that axis, like `x`, NOT a relative value.", "editType": "calcIfAutorange", "role": "info", "valType": "any" }, "axref": { "description": "Indicates in what terms the tail of the annotation (ax,ay) is specified. If `pixel`, `ax` is a relative offset in pixels from `x`. If set to an x axis id (e.g. *x* or *x2*), `ax` is specified in the same terms as that axis. This is useful for trendline annotations which should continue to indicate the correct trend when zoomed.", "dflt": "pixel", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "pixel", "/^x([2-9]|[1-9][0-9]+)?$/" ] }, "ay": { "description": "Sets the y component of the arrow tail about the arrow head. If `ayref` is `pixel`, a positive (negative) component corresponds to an arrow pointing from bottom to top (top to bottom). If `ayref` is an axis, this is an absolute value on that axis, like `y`, NOT a relative value.", "editType": "calcIfAutorange", "role": "info", "valType": "any" }, "ayref": { "description": "Indicates in what terms the tail of the annotation (ax,ay) is specified. If `pixel`, `ay` is a relative offset in pixels from `y`. If set to a y axis id (e.g. *y* or *y2*), `ay` is specified in the same terms as that axis. This is useful for trendline annotations which should continue to indicate the correct trend when zoomed.", "dflt": "pixel", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "pixel", "/^y([2-9]|[1-9][0-9]+)?$/" ] }, "bgcolor": { "description": "Sets the background color of the annotation.", "dflt": "rgba(0,0,0,0)", "editType": "arraydraw", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the color of the border enclosing the annotation `text`.", "dflt": "rgba(0,0,0,0)", "editType": "arraydraw", "role": "style", "valType": "color" }, "borderpad": { "description": "Sets the padding (in px) between the `text` and the enclosing border.", "dflt": 1, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "borderwidth": { "description": "Sets the width (in px) of the border enclosing the annotation `text`.", "dflt": 1, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "captureevents": { "description": "Determines whether the annotation text box captures mouse move and click events, or allows those events to pass through to data points in the plot that may be behind the annotation. By default `captureevents` is *false* unless `hovertext` is provided. If you use the event `plotly_clickannotation` without `hovertext` you must explicitly enable `captureevents`.", "editType": "arraydraw", "role": "info", "valType": "boolean" }, "clicktoshow": { "description": "Makes this annotation respond to clicks on the plot. If you click a data point that exactly matches the `x` and `y` values of this annotation, and it is hidden (visible: false), it will appear. In *onoff* mode, you must click the same point again to make it disappear, so if you click multiple points, you can show multiple annotations. In *onout* mode, a click anywhere else in the plot (on another data point or not) will hide this annotation. If you need to show/hide this annotation in response to different `x` or `y` values, you can set `xclick` and/or `yclick`. This is useful for example to label the side of a bar. To label markers though, `standoff` is preferred over `xclick` and `yclick`.", "dflt": false, "editType": "arraydraw", "role": "style", "valType": "enumerated", "values": [ false, "onoff", "onout" ] }, "editType": "calc", "font": { "color": { "editType": "arraydraw", "role": "style", "valType": "color" }, "description": "Sets the annotation text font.", "editType": "calcIfAutorange", "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*.", "editType": "calcIfAutorange", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calcIfAutorange", "min": 1, "role": "style", "valType": "number" } }, "height": { "description": "Sets an explicit height for the text box. null (default) lets the text set the box height. Taller text will be clipped.", "dflt": null, "editType": "calcIfAutorange", "min": 1, "role": "style", "valType": "number" }, "hoverlabel": { "bgcolor": { "description": "Sets the background color of the hover label. By default uses the annotation's `bgcolor` made opaque, or white if it was transparent.", "editType": "arraydraw", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the border color of the hover label. By default uses either dark grey or white, for maximum contrast with `hoverlabel.bgcolor`.", "editType": "arraydraw", "role": "style", "valType": "color" }, "editType": "arraydraw", "font": { "color": { "editType": "arraydraw", "role": "style", "valType": "color" }, "description": "Sets the hover label text font. By default uses the global hover font and size, with color from `hoverlabel.bordercolor`.", "editType": "arraydraw", "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*.", "editType": "arraydraw", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "arraydraw", "min": 1, "role": "style", "valType": "number" } }, "role": "object" }, "hovertext": { "description": "Sets text to appear when hovering over this annotation. If omitted or blank, no hover label will appear.", "editType": "arraydraw", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the annotation (text + arrow).", "dflt": 1, "editType": "arraydraw", "max": 1, "min": 0, "role": "style", "valType": "number" }, "role": "object", "showarrow": { "description": "Determines whether or not the annotation is drawn with an arrow. If *true*, `text` is placed near the arrow's tail. If *false*, `text` lines up with the `x` and `y` provided.", "dflt": true, "editType": "calcIfAutorange", "role": "style", "valType": "boolean" }, "standoff": { "description": "Sets a distance, in pixels, to move the arrowhead away from the position it is pointing at, for example to point at the edge of a marker independent of zoom. Note that this shortens the arrow from the `ax` / `ay` vector, in contrast to `xshift` / `yshift` which moves everything by this amount.", "dflt": 0, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "text": { "description": "Sets the text associated with this annotation. Plotly uses a subset of HTML tags to do things like newline (
), bold (), italics (), hyperlinks (). Tags , , are also supported.", "editType": "calcIfAutorange", "role": "info", "valType": "string" }, "textangle": { "description": "Sets the angle at which the `text` is drawn with respect to the horizontal.", "dflt": 0, "editType": "calcIfAutorange", "role": "style", "valType": "angle" }, "valign": { "description": "Sets the vertical alignment of the `text` within the box. Has an effect only if an explicit height is set to override the text height.", "dflt": "middle", "editType": "arraydraw", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "visible": { "description": "Determines whether or not this annotation is visible.", "dflt": true, "editType": "calcIfAutorange", "role": "info", "valType": "boolean" }, "width": { "description": "Sets an explicit width for the text box. null (default) lets the text set the box width. Wider text will be clipped. There is no automatic wrapping; use
to start a new line.", "dflt": null, "editType": "calcIfAutorange", "min": 1, "role": "style", "valType": "number" }, "x": { "description": "Sets the annotation's x position. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calcIfAutorange", "role": "info", "valType": "any" }, "xanchor": { "description": "Sets the text box's horizontal position anchor This anchor binds the `x` position to the *left*, *center* or *right* of the annotation. For example, if `x` is set to 1, `xref` to *paper* and `xanchor` to *right* then the right-most portion of the annotation lines up with the right-most edge of the plotting area. If *auto*, the anchor is equivalent to *center* for data-referenced annotations or if there is an arrow, whereas for paper-referenced with no arrow, the anchor picked corresponds to the closest side.", "dflt": "auto", "editType": "calcIfAutorange", "role": "info", "valType": "enumerated", "values": [ "auto", "left", "center", "right" ] }, "xclick": { "description": "Toggle this annotation when clicking a data point whose `x` value is `xclick` rather than the annotation's `x` value.", "editType": "arraydraw", "role": "info", "valType": "any" }, "xref": { "description": "Sets the annotation'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.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "paper", "/^x([2-9]|[1-9][0-9]+)?$/" ] }, "xshift": { "description": "Shifts the position of the whole annotation and arrow to the right (positive) or left (negative) by this many pixels.", "dflt": 0, "editType": "calcIfAutorange", "role": "style", "valType": "number" }, "y": { "description": "Sets the annotation's y position. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calcIfAutorange", "role": "info", "valType": "any" }, "yanchor": { "description": "Sets the text box's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the annotation. For example, if `y` is set to 1, `yref` to *paper* and `yanchor` to *top* then the top-most portion of the annotation lines up with the top-most edge of the plotting area. If *auto*, the anchor is equivalent to *middle* for data-referenced annotations or if there is an arrow, whereas for paper-referenced with no arrow, the anchor picked corresponds to the closest side.", "dflt": "auto", "editType": "calcIfAutorange", "role": "info", "valType": "enumerated", "values": [ "auto", "top", "middle", "bottom" ] }, "yclick": { "description": "Toggle this annotation when clicking a data point whose `y` value is `yclick` rather than the annotation's `y` value.", "editType": "arraydraw", "role": "info", "valType": "any" }, "yref": { "description": "Sets the annotation's y coordinate axis. If set to an y axis id (e.g. *y* or *y2*), the `y` position refers to an y coordinate If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where 0 (1) corresponds to the bottom (top).", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "paper", "/^y([2-9]|[1-9][0-9]+)?$/" ] }, "yshift": { "description": "Shifts the position of the whole annotation and arrow up (positive) or down (negative) by this many pixels.", "dflt": 0, "editType": "calcIfAutorange", "role": "style", "valType": "number" } } }, "role": "object" }, "autosize": { "description": "Determines whether or not a layout width or height that has been left undefined by the user is initialized on each relayout. Note that, regardless of this attribute, an undefined layout width or height is always initialized on the first call to plot.", "dflt": false, "editType": "none", "role": "info", "valType": "boolean" }, "calendar": { "description": "Sets the default calendar system to use for interpreting and displaying dates throughout the plot.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "direction": { "description": "For polar plots only. Sets the direction corresponding to positive angles.", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "clockwise", "counterclockwise" ] }, "dragmode": { "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", "editType": "modebar", "role": "info", "valType": "enumerated", "values": [ "zoom", "pan", "select", "lasso", "orbit", "turntable" ] }, "editType": "plot", "font": { "color": { "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the global font. Note that fonts used in traces and other layout components inherit from the global font.", "editType": "calc", "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*.", "dflt": "\"Open Sans\", verdana, arial, sans-serif", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "dflt": 12, "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "geo": { "_isSubplotObj": true, "bgcolor": { "description": "Set the background color of the map", "dflt": "#fff", "editType": "plot", "role": "style", "valType": "color" }, "center": { "editType": "plot", "lat": { "description": "Sets the latitude of the map's center. For all projection types, the map's latitude center lies at the middle of the latitude range by default.", "editType": "plot", "role": "info", "valType": "number" }, "lon": { "description": "Sets the longitude of the map's center. By default, the map's longitude center lies at the middle of the longitude range for scoped projection and above `projection.rotation.lon` otherwise.", "editType": "plot", "role": "info", "valType": "number" }, "role": "object" }, "coastlinecolor": { "description": "Sets the coastline color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "coastlinewidth": { "description": "Sets the coastline stroke width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "countrycolor": { "description": "Sets line color of the country boundaries.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "countrywidth": { "description": "Sets line width (in px) of the country boundaries.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "domain": { "editType": "plot", "role": "object", "x": { "description": "Sets the maximum horizontal domain of this map (in plot fraction). Note that geo subplots are constrained by domain. In general, when `projection.scale` is set to 1. a map will fit either its x or y domain, but not both. ", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "y": { "description": "Sets the maximum vertical domain of this map (in plot fraction). Note that geo subplots are constrained by domain. In general, when `projection.scale` is set to 1. a map will fit either its x or y domain, but not both. ", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "editType": "plot", "framecolor": { "description": "Sets the color the frame.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "framewidth": { "description": "Sets the stroke width (in px) of the frame.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "lakecolor": { "description": "Sets the color of the lakes.", "dflt": "#3399FF", "editType": "plot", "role": "style", "valType": "color" }, "landcolor": { "description": "Sets the land mass color.", "dflt": "#F0DC82", "editType": "plot", "role": "style", "valType": "color" }, "lataxis": { "dtick": { "description": "Sets the graticule's longitude/latitude tick step.", "editType": "plot", "role": "info", "valType": "number" }, "editType": "plot", "gridcolor": { "description": "Sets the graticule's stroke color.", "dflt": "#eee", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the graticule's stroke width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "range": { "description": "Sets the range of this axis (in degrees), sets the map's clipped coordinates.", "editType": "plot", "items": [ { "editType": "plot", "valType": "number" }, { "editType": "plot", "valType": "number" } ], "role": "info", "valType": "info_array" }, "role": "object", "showgrid": { "description": "Sets whether or not graticule are shown on the map.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "tick0": { "description": "Sets the graticule's starting tick longitude/latitude.", "editType": "plot", "role": "info", "valType": "number" } }, "lonaxis": { "dtick": { "description": "Sets the graticule's longitude/latitude tick step.", "editType": "plot", "role": "info", "valType": "number" }, "editType": "plot", "gridcolor": { "description": "Sets the graticule's stroke color.", "dflt": "#eee", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the graticule's stroke width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "range": { "description": "Sets the range of this axis (in degrees), sets the map's clipped coordinates.", "editType": "plot", "items": [ { "editType": "plot", "valType": "number" }, { "editType": "plot", "valType": "number" } ], "role": "info", "valType": "info_array" }, "role": "object", "showgrid": { "description": "Sets whether or not graticule are shown on the map.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "tick0": { "description": "Sets the graticule's starting tick longitude/latitude.", "editType": "plot", "role": "info", "valType": "number" } }, "oceancolor": { "description": "Sets the ocean color", "dflt": "#3399FF", "editType": "plot", "role": "style", "valType": "color" }, "projection": { "editType": "plot", "parallels": { "description": "For conic projection types only. Sets the parallels (tangent, secant) where the cone intersects the sphere.", "editType": "plot", "items": [ { "editType": "plot", "valType": "number" }, { "editType": "plot", "valType": "number" } ], "role": "info", "valType": "info_array" }, "role": "object", "rotation": { "editType": "plot", "lat": { "description": "Rotates the map along meridians (in degrees North).", "editType": "plot", "role": "info", "valType": "number" }, "lon": { "description": "Rotates the map along parallels (in degrees East). Defaults to the center of the `lonaxis.range` values.", "editType": "plot", "role": "info", "valType": "number" }, "role": "object", "roll": { "description": "Roll the map (in degrees) For example, a roll of *180* makes the map appear upside down.", "editType": "plot", "role": "info", "valType": "number" } }, "scale": { "description": "Zooms in or out on the map view. A scale of *1* corresponds to the largest zoom level that fits the map's lon and lat ranges. ", "dflt": 1, "editType": "plot", "min": 0, "role": "info", "valType": "number" }, "type": { "description": "Sets the projection type.", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "equirectangular", "mercator", "orthographic", "natural earth", "kavrayskiy7", "miller", "robinson", "eckert4", "azimuthal equal area", "azimuthal equidistant", "conic equal area", "conic conformal", "conic equidistant", "gnomonic", "stereographic", "mollweide", "hammer", "transverse mercator", "albers usa", "winkel tripel", "aitoff", "sinusoidal" ] } }, "resolution": { "coerceNumber": true, "description": "Sets the resolution of the base layers. The values have units of km/mm e.g. 110 corresponds to a scale ratio of 1:110,000,000.", "dflt": 110, "editType": "plot", "role": "info", "valType": "enumerated", "values": [ 110, 50 ] }, "rivercolor": { "description": "Sets color of the rivers.", "dflt": "#3399FF", "editType": "plot", "role": "style", "valType": "color" }, "riverwidth": { "description": "Sets the stroke width (in px) of the rivers.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "role": "object", "scope": { "description": "Set the scope of the map.", "dflt": "world", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "world", "usa", "europe", "asia", "africa", "north america", "south america" ] }, "showcoastlines": { "description": "Sets whether or not the coastlines are drawn.", "editType": "plot", "role": "info", "valType": "boolean" }, "showcountries": { "description": "Sets whether or not country boundaries are drawn.", "editType": "plot", "role": "info", "valType": "boolean" }, "showframe": { "description": "Sets whether or not a frame is drawn around the map.", "editType": "plot", "role": "info", "valType": "boolean" }, "showlakes": { "description": "Sets whether or not lakes are drawn.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "showland": { "description": "Sets whether or not land masses are filled in color.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "showocean": { "description": "Sets whether or not oceans are filled in color.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "showrivers": { "description": "Sets whether or not rivers are drawn.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "showsubunits": { "description": "Sets whether or not boundaries of subunits within countries (e.g. states, provinces) are drawn.", "editType": "plot", "role": "info", "valType": "boolean" }, "subunitcolor": { "description": "Sets the color of the subunits boundaries.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "subunitwidth": { "description": "Sets the stroke width (in px) of the subunits boundaries.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" } }, "height": { "description": "Sets the plot's height (in px).", "dflt": 450, "editType": "none", "min": 10, "role": "info", "valType": "number" }, "hidesources": { "description": "Determines whether or not a text link citing the data source is placed at the bottom-right cored of the figure. Has only an effect only on graphs that have been generated via forked graphs from the plotly service (at https://plot.ly or on-premise).", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "hoverlabel": { "bgcolor": { "description": "Sets the background color of all hover labels on graph", "editType": "none", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the border color of all hover labels on graph.", "editType": "none", "role": "style", "valType": "color" }, "editType": "none", "font": { "color": { "editType": "none", "role": "style", "valType": "color" }, "description": "Sets the default hover label font used by all traces on the graph.", "editType": "none", "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*.", "dflt": "Arial, sans-serif", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "dflt": 13, "editType": "none", "min": 1, "role": "style", "valType": "number" } }, "namelength": { "description": "Sets the default length (in number of characters) of the trace name in the hover labels for all traces. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "dflt": 15, "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "role": "object" }, "hovermode": { "description": "Determines the mode of hover interactions.", "editType": "modebar", "role": "info", "valType": "enumerated", "values": [ "x", "y", "closest", false ] }, "images": { "items": { "image": { "editType": "arraydraw", "layer": { "description": "Specifies whether images are drawn below or above traces. When `xref` and `yref` are both set to `paper`, image is drawn below the entire plot area.", "dflt": "above", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "below", "above" ] }, "opacity": { "description": "Sets the opacity of the image.", "dflt": 1, "editType": "arraydraw", "max": 1, "min": 0, "role": "info", "valType": "number" }, "role": "object", "sizex": { "description": "Sets the image container size horizontally. The image will be sized based on the `position` value. When `xref` is set to `paper`, units are sized relative to the plot width.", "dflt": 0, "editType": "arraydraw", "role": "info", "valType": "number" }, "sizey": { "description": "Sets the image container size vertically. The image will be sized based on the `position` value. When `yref` is set to `paper`, units are sized relative to the plot height.", "dflt": 0, "editType": "arraydraw", "role": "info", "valType": "number" }, "sizing": { "description": "Specifies which dimension of the image to constrain.", "dflt": "contain", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "fill", "contain", "stretch" ] }, "source": { "description": "Specifies the URL of the image to be used. The URL must be accessible from the domain where the plot code is run, and can be either relative or absolute.", "editType": "arraydraw", "role": "info", "valType": "string" }, "visible": { "description": "Determines whether or not this image is visible.", "dflt": true, "editType": "arraydraw", "role": "info", "valType": "boolean" }, "x": { "description": "Sets the image's x position. When `xref` is set to `paper`, units are sized relative to the plot height. See `xref` for more info", "dflt": 0, "editType": "arraydraw", "role": "info", "valType": "any" }, "xanchor": { "description": "Sets the anchor for the x position", "dflt": "left", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xref": { "description": "Sets the images's x coordinate axis. If set to a x axis id (e.g. *x* or *x2*), the `x` position refers to an x data coordinate If set to *paper*, the `x` position refers to the distance from the left of plot in normalized coordinates where *0* (*1*) corresponds to the left (right).", "dflt": "paper", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "paper", "/^x([2-9]|[1-9][0-9]+)?$/" ] }, "y": { "description": "Sets the image's y position. When `yref` is set to `paper`, units are sized relative to the plot height. See `yref` for more info", "dflt": 0, "editType": "arraydraw", "role": "info", "valType": "any" }, "yanchor": { "description": "Sets the anchor for the y position.", "dflt": "top", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "yref": { "description": "Sets the images's y coordinate axis. If set to a y axis id (e.g. *y* or *y2*), the `y` position refers to a y data coordinate. If set to *paper*, the `y` position refers to the distance from the bottom of the plot in normalized coordinates where *0* (*1*) corresponds to the bottom (top).", "dflt": "paper", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "paper", "/^y([2-9]|[1-9][0-9]+)?$/" ] } } }, "role": "object" }, "legend": { "bgcolor": { "description": "Sets the legend background color.", "editType": "legend", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the color of the border enclosing the legend.", "dflt": "#444", "editType": "legend", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) of the border enclosing the legend.", "dflt": 0, "editType": "legend", "min": 0, "role": "style", "valType": "number" }, "editType": "legend", "font": { "color": { "editType": "legend", "role": "style", "valType": "color" }, "description": "Sets the font used to text the legend items.", "editType": "legend", "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*.", "editType": "legend", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "legend", "min": 1, "role": "style", "valType": "number" } }, "orientation": { "description": "Sets the orientation of the legend.", "dflt": "v", "editType": "legend", "role": "info", "valType": "enumerated", "values": [ "v", "h" ] }, "role": "object", "tracegroupgap": { "description": "Sets the amount of vertical space (in px) between legend groups.", "dflt": 10, "editType": "legend", "min": 0, "role": "style", "valType": "number" }, "traceorder": { "description": "Determines the order at which the legend items are displayed. If *normal*, the items are displayed top-to-bottom in the same order as the input data. If *reversed*, the items are displayed in the opposite order as *normal*. If *grouped*, the items are displayed in groups (when a trace `legendgroup` is provided). if *grouped+reversed*, the items are displayed in the opposite order as *grouped*.", "editType": "legend", "extras": [ "normal" ], "flags": [ "reversed", "grouped" ], "role": "style", "valType": "flaglist" }, "x": { "description": "Sets the x position (in normalized coordinates) of the legend.", "dflt": 1.02, "editType": "legend", "max": 3, "min": -2, "role": "style", "valType": "number" }, "xanchor": { "description": "Sets the legend's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the legend.", "dflt": "left", "editType": "legend", "role": "info", "valType": "enumerated", "values": [ "auto", "left", "center", "right" ] }, "y": { "description": "Sets the y position (in normalized coordinates) of the legend.", "dflt": 1, "editType": "legend", "max": 3, "min": -2, "role": "style", "valType": "number" }, "yanchor": { "description": "Sets the legend's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the legend.", "dflt": "auto", "editType": "legend", "role": "info", "valType": "enumerated", "values": [ "auto", "top", "middle", "bottom" ] } }, "mapbox": { "_arrayAttrRegexps": [ {} ], "_isSubplotObj": true, "accesstoken": { "description": "Sets the mapbox access token to be used for this mapbox map. Alternatively, the mapbox access token can be set in the configuration options under `mapboxAccessToken`.", "editType": "plot", "noBlank": true, "role": "info", "strict": true, "valType": "string" }, "bearing": { "description": "Sets the bearing angle of the map (in degrees counter-clockwise from North).", "dflt": 0, "editType": "plot", "role": "info", "valType": "number" }, "center": { "editType": "plot", "lat": { "description": "Sets the latitude of the center of the map (in degrees North).", "dflt": 0, "editType": "plot", "role": "info", "valType": "number" }, "lon": { "description": "Sets the longitude of the center of the map (in degrees East).", "dflt": 0, "editType": "plot", "role": "info", "valType": "number" }, "role": "object" }, "domain": { "editType": "plot", "role": "object", "x": { "description": "Sets the horizontal domain of this subplot (in plot fraction).", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "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 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "editType": "plot", "layers": { "items": { "layer": { "below": { "description": "Determines if the layer will be inserted before the layer with the specified ID. If omitted or set to '', the layer will be inserted above every existing layer.", "dflt": "", "editType": "plot", "role": "info", "valType": "string" }, "circle": { "editType": "plot", "radius": { "description": "Sets the circle radius. Has an effect only when `type` is set to *circle*.", "dflt": 15, "editType": "plot", "role": "style", "valType": "number" }, "role": "object" }, "color": { "description": "Sets the primary layer color. If `type` is *circle*, color corresponds to the circle color If `type` is *line*, color corresponds to the line color If `type` is *fill*, color corresponds to the fill color If `type` is *symbol*, color corresponds to the icon color", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "editType": "plot", "fill": { "editType": "plot", "outlinecolor": { "description": "Sets the fill outline color. Has an effect only when `type` is set to *fill*.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "role": "object" }, "line": { "editType": "plot", "role": "object", "width": { "description": "Sets the line width. Has an effect only when `type` is set to *line*.", "dflt": 2, "editType": "plot", "role": "style", "valType": "number" } }, "opacity": { "description": "Sets the opacity of the layer.", "dflt": 1, "editType": "plot", "max": 1, "min": 0, "role": "info", "valType": "number" }, "role": "object", "source": { "description": "Sets the source data for this layer. Source can be either a URL, a geojson object (with `sourcetype` set to *geojson*) or an array of tile URLS (with `sourcetype` set to *vector*).", "editType": "plot", "role": "info", "valType": "any" }, "sourcelayer": { "description": "Specifies the layer to use from a vector tile source. Required for *vector* source type that supports multiple layers.", "dflt": "", "editType": "plot", "role": "info", "valType": "string" }, "sourcetype": { "description": "Sets the source type for this layer. Support for *raster*, *image* and *video* source types is coming soon.", "dflt": "geojson", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "geojson", "vector" ] }, "symbol": { "editType": "plot", "icon": { "description": "Sets the symbol icon image. Full list: https://www.mapbox.com/maki-icons/", "dflt": "marker", "editType": "plot", "role": "style", "valType": "string" }, "iconsize": { "description": "Sets the symbol icon size. Has an effect only when `type` is set to *symbol*.", "dflt": 10, "editType": "plot", "role": "style", "valType": "number" }, "role": "object", "text": { "description": "Sets the symbol text.", "dflt": "", "editType": "plot", "role": "info", "valType": "string" }, "textfont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the icon text font. Has an effect only when `type` is set to *symbol*.", "editType": "plot", "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*.", "dflt": "Open Sans Regular, Arial Unicode MS Regular", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "textposition": { "arrayOk": false, "description": "Sets the positions of the `text` elements with respects to the (x,y) coordinates.", "dflt": "middle center", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right" ] } }, "type": { "description": "Sets the layer type. Support for *raster*, *background* types is coming soon. Note that *line* and *fill* are not compatible with Point GeoJSON geometries.", "dflt": "circle", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "circle", "line", "fill", "symbol" ] } } }, "role": "object" }, "pitch": { "description": "Sets the pitch angle of the map (in degrees, where *0* means perpendicular to the surface of the map).", "dflt": 0, "editType": "plot", "role": "info", "valType": "number" }, "role": "object", "style": { "description": "Sets the Mapbox map style. Either input one of the default Mapbox style names or the URL to a custom style or a valid Mapbox style JSON.", "dflt": "basic", "editType": "plot", "role": "style", "valType": "any", "values": [ "basic", "streets", "outdoors", "light", "dark", "satellite", "satellite-streets" ] }, "zoom": { "description": "Sets the zoom level of the map.", "dflt": 1, "editType": "plot", "role": "info", "valType": "number" } }, "margin": { "autoexpand": { "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "b": { "description": "Sets the bottom margin (in px).", "dflt": 80, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "editType": "calc", "l": { "description": "Sets the left margin (in px).", "dflt": 80, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "pad": { "description": "Sets the amount of padding (in px) between the plotting area and the axis lines", "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "r": { "description": "Sets the right margin (in px).", "dflt": 80, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "role": "object", "t": { "description": "Sets the top margin (in px).", "dflt": 100, "editType": "calc", "min": 0, "role": "info", "valType": "number" } }, "orientation": { "description": "For polar plots only. Rotates the entire polar by the given angle.", "editType": "plot", "role": "info", "valType": "angle" }, "paper_bgcolor": { "description": "Sets the color of paper where the graph is drawn.", "dflt": "#fff", "editType": "plot", "role": "style", "valType": "color" }, "plot_bgcolor": { "description": "Sets the color of plotting area in-between x and y axes.", "dflt": "#fff", "editType": "layoutstyle", "role": "style", "valType": "color" }, "radialaxis": { "domain": { "description": "Polar chart subplots are not supported yet. This key has currently no effect.", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "editType": "plot", "endpadding": { "editType": "plot", "role": "style", "valType": "number" }, "orientation": { "description": "Sets the orientation (an angle with respect to the origin) of the radial axis.", "editType": "plot", "role": "style", "valType": "number" }, "range": { "description": "Defines the start and end point of this radial axis.", "editType": "plot", "items": [ { "editType": "plot", "valType": "number" }, { "editType": "plot", "valType": "number" } ], "role": "info", "valType": "info_array" }, "role": "object", "showline": { "description": "Determines whether or not the line bounding this radial axis will be shown on the figure.", "editType": "plot", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the radial axis ticks will feature tick labels.", "editType": "plot", "role": "style", "valType": "boolean" }, "tickcolor": { "description": "Sets the color of the tick lines on this radial axis.", "editType": "plot", "role": "style", "valType": "color" }, "ticklen": { "description": "Sets the length of the tick lines on this radial axis.", "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "tickorientation": { "description": "Sets the orientation (from the paper perspective) of the radial axis tick labels.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "horizontal", "vertical" ] }, "ticksuffix": { "description": "Sets the length of the tick lines on this radial axis.", "editType": "plot", "role": "style", "valType": "string" }, "visible": { "description": "Determines whether or not this axis will be visible.", "editType": "plot", "role": "info", "valType": "boolean" } }, "scene": { "_arrayAttrRegexps": [ {} ], "_deprecated": { "cameraposition": { "description": "Obsolete. Use `camera` instead.", "editType": "camera", "role": "info", "valType": "info_array" } }, "_isSubplotObj": true, "annotations": { "items": { "annotation": { "align": { "description": "Sets the horizontal alignment of the `text` within the box. Has an effect only if `text` spans more two or more lines (i.e. `text` contains one or more
HTML tags) or if an explicit width is set to override the text width.", "dflt": "center", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "arrowcolor": { "description": "Sets the color of the annotation arrow.", "editType": "calc", "role": "style", "valType": "color" }, "arrowhead": { "description": "Sets the annotation arrow head style.", "dflt": 1, "editType": "calc", "max": 8, "min": 0, "role": "style", "valType": "integer" }, "arrowsize": { "description": "Sets the size of the annotation arrow head, relative to `arrowwidth`. A value of 1 (default) gives a head about 3x as wide as the line.", "dflt": 1, "editType": "calc", "min": 0.3, "role": "style", "valType": "number" }, "arrowwidth": { "description": "Sets the width (in px) of annotation arrow line.", "editType": "calc", "min": 0.1, "role": "style", "valType": "number" }, "ax": { "description": "Sets the x component of the arrow tail about the arrow head (in pixels).", "editType": "calc", "role": "info", "valType": "number" }, "ay": { "description": "Sets the y component of the arrow tail about the arrow head (in pixels).", "editType": "calc", "role": "info", "valType": "number" }, "bgcolor": { "description": "Sets the background color of the annotation.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the color of the border enclosing the annotation `text`.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "borderpad": { "description": "Sets the padding (in px) between the `text` and the enclosing border.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "borderwidth": { "description": "Sets the width (in px) of the border enclosing the annotation `text`.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "captureevents": { "description": "Determines whether the annotation text box captures mouse move and click events, or allows those events to pass through to data points in the plot that may be behind the annotation. By default `captureevents` is *false* unless `hovertext` is provided. If you use the event `plotly_clickannotation` without `hovertext` you must explicitly enable `captureevents`.", "editType": "calc", "role": "info", "valType": "boolean" }, "editType": "calc", "font": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the annotation text font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "height": { "description": "Sets an explicit height for the text box. null (default) lets the text set the box height. Taller text will be clipped.", "dflt": null, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "hoverlabel": { "bgcolor": { "description": "Sets the background color of the hover label. By default uses the annotation's `bgcolor` made opaque, or white if it was transparent.", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the border color of the hover label. By default uses either dark grey or white, for maximum contrast with `hoverlabel.bgcolor`.", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "font": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the hover label text font. By default uses the global hover font and size, with color from `hoverlabel.bordercolor`.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "role": "object" }, "hovertext": { "description": "Sets text to appear when hovering over this annotation. If omitted or blank, no hover label will appear.", "editType": "calc", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the annotation (text + arrow).", "dflt": 1, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "role": "object", "showarrow": { "description": "Determines whether or not the annotation is drawn with an arrow. If *true*, `text` is placed near the arrow's tail. If *false*, `text` lines up with the `x` and `y` provided.", "dflt": true, "editType": "calc", "role": "style", "valType": "boolean" }, "standoff": { "description": "Sets a distance, in pixels, to move the arrowhead away from the position it is pointing at, for example to point at the edge of a marker independent of zoom. Note that this shortens the arrow from the `ax` / `ay` vector, in contrast to `xshift` / `yshift` which moves everything by this amount.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "text": { "description": "Sets the text associated with this annotation. Plotly uses a subset of HTML tags to do things like newline (
), bold (), italics (), hyperlinks (). Tags , , are also supported.", "editType": "calc", "role": "info", "valType": "string" }, "textangle": { "description": "Sets the angle at which the `text` is drawn with respect to the horizontal.", "dflt": 0, "editType": "calc", "role": "style", "valType": "angle" }, "valign": { "description": "Sets the vertical alignment of the `text` within the box. Has an effect only if an explicit height is set to override the text height.", "dflt": "middle", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "visible": { "description": "Determines whether or not this annotation is visible.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets an explicit width for the text box. null (default) lets the text set the box width. Wider text will be clipped. There is no automatic wrapping; use
to start a new line.", "dflt": null, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "x": { "description": "Sets the annotation's x position.", "editType": "calc", "role": "info", "valType": "any" }, "xanchor": { "description": "Sets the text box's horizontal position anchor This anchor binds the `x` position to the *left*, *center* or *right* of the annotation. For example, if `x` is set to 1, `xref` to *paper* and `xanchor` to *right* then the right-most portion of the annotation lines up with the right-most edge of the plotting area. If *auto*, the anchor is equivalent to *center* for data-referenced annotations or if there is an arrow, whereas for paper-referenced with no arrow, the anchor picked corresponds to the closest side.", "dflt": "auto", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "auto", "left", "center", "right" ] }, "xshift": { "description": "Shifts the position of the whole annotation and arrow to the right (positive) or left (negative) by this many pixels.", "dflt": 0, "editType": "calc", "role": "style", "valType": "number" }, "y": { "description": "Sets the annotation's y position.", "editType": "calc", "role": "info", "valType": "any" }, "yanchor": { "description": "Sets the text box's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the annotation. For example, if `y` is set to 1, `yref` to *paper* and `yanchor` to *top* then the top-most portion of the annotation lines up with the top-most edge of the plotting area. If *auto*, the anchor is equivalent to *middle* for data-referenced annotations or if there is an arrow, whereas for paper-referenced with no arrow, the anchor picked corresponds to the closest side.", "dflt": "auto", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "auto", "top", "middle", "bottom" ] }, "yshift": { "description": "Shifts the position of the whole annotation and arrow up (positive) or down (negative) by this many pixels.", "dflt": 0, "editType": "calc", "role": "style", "valType": "number" }, "z": { "description": "Sets the annotation's z position.", "editType": "calc", "role": "info", "valType": "any" } } }, "role": "object" }, "aspectmode": { "description": "If *cube*, this scene's axes are drawn as a cube, regardless of the axes' ranges. If *data*, this scene's axes are drawn in proportion with the axes' ranges. If *manual*, this scene's axes are drawn in proportion with the input of *aspectratio* (the default behavior if *aspectratio* is provided). If *auto*, this scene's axes are drawn using the results of *data* except when one axis is more than four times the size of the two others, where in that case the results of *cube* are used.", "dflt": "auto", "editType": "plot", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "cube", "data", "manual" ] }, "aspectratio": { "description": "Sets this scene's axis aspectratio.", "editType": "plot", "impliedEdits": { "aspectmode": "manual", "role": "object" }, "role": "object", "x": { "editType": "plot", "impliedEdits": { "^aspectmode": "manual" }, "min": 0, "role": "info", "valType": "number" }, "y": { "editType": "plot", "impliedEdits": { "^aspectmode": "manual" }, "min": 0, "role": "info", "valType": "number" }, "z": { "editType": "plot", "impliedEdits": { "^aspectmode": "manual" }, "min": 0, "role": "info", "valType": "number" } }, "bgcolor": { "dflt": "rgba(0,0,0,0)", "editType": "plot", "role": "style", "valType": "color" }, "camera": { "center": { "description": "Sets the (x,y,z) components of the 'center' camera vector This vector determines the translation (x,y,z) space about the center of this scene. By default, there is no such translation.", "editType": "camera", "role": "object", "x": { "dflt": 0, "editType": "camera", "role": "info", "valType": "number" }, "y": { "dflt": 0, "editType": "camera", "role": "info", "valType": "number" }, "z": { "dflt": 0, "editType": "camera", "role": "info", "valType": "number" } }, "editType": "camera", "eye": { "description": "Sets the (x,y,z) components of the 'eye' camera vector. This vector determines the view point about the origin of this scene.", "editType": "camera", "role": "object", "x": { "dflt": 1.25, "editType": "camera", "role": "info", "valType": "number" }, "y": { "dflt": 1.25, "editType": "camera", "role": "info", "valType": "number" }, "z": { "dflt": 1.25, "editType": "camera", "role": "info", "valType": "number" } }, "role": "object", "up": { "description": "Sets the (x,y,z) components of the 'up' camera vector. This vector determines the up direction of this scene with respect to the page. The default is *{x: 0, y: 0, z: 1}* which means that the z axis points up.", "editType": "camera", "role": "object", "x": { "dflt": 0, "editType": "camera", "role": "info", "valType": "number" }, "y": { "dflt": 0, "editType": "camera", "role": "info", "valType": "number" }, "z": { "dflt": 1, "editType": "camera", "role": "info", "valType": "number" } } }, "domain": { "editType": "plot", "role": "object", "x": { "description": "Sets the horizontal domain of this scene (in plot fraction).", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "y": { "description": "Sets the vertical domain of this scene (in plot fraction).", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "dragmode": { "description": "Determines the mode of drag interactions for this scene.", "dflt": "turntable", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "orbit", "turntable", "zoom", "pan", false ] }, "editType": "plot", "hovermode": { "description": "Determines the mode of hover interactions for this scene.", "dflt": "closest", "editType": "modebar", "role": "info", "valType": "enumerated", "values": [ "closest", false ] }, "role": "object", "xaxis": { "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, "editType": "plot", "impliedEdits": {}, "role": "style", "valType": "enumerated", "values": [ true, false, "reversed" ] }, "backgroundcolor": { "description": "Sets the background color of this axis' wall.", "dflt": "rgba(204, 204, 204, 0.5)", "editType": "plot", "role": "style", "valType": "color" }, "calendar": { "description": "Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar`", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "categoryarraysrc": { "description": "Sets the source reference on plot.ly for categoryarray .", "editType": "none", "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", "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "color" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "none", "e", "E", "power", "SI", "B" ] }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "rgb(204, 204, 204)", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "plot", "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, "editType": "plot", "role": "style", "valType": "enumerated", "values": [ true, "ticks", false, "all", "allticks" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "integer" }, "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "autorange": false }, "items": [ { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" }, { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" } ], "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "normal", "tozero", "nonnegative" ] }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showaxeslabels": { "description": "Sets whether or not this axis is labeled", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "showbackground": { "description": "Sets whether or not this axis' wall has a background color.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "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", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showspikes": { "description": "Sets whether or not spikes starting from data points to this axis' wall are shown on hover.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "spikecolor": { "description": "Sets the color of the spikes.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "spikesides": { "description": "Sets whether or not spikes extending from the projection data points to this axis' wall boundaries are shown on hover.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "spikethickness": { "description": "Sets the thickness (in px) of the spikes.", "dflt": 2, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "plot", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "plot", "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).", "editType": "plot", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "plot", "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 `tickvals`.", "editType": "plot", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "plot", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "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": "-", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "-", "linear", "log", "date", "category" ] }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", "role": "info", "valType": "boolean" }, "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.", "editType": "plot", "role": "style", "valType": "boolean" }, "zerolinecolor": { "description": "Sets the line color of the zero line.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "zerolinewidth": { "description": "Sets the width (in px) of the zero line.", "dflt": 1, "editType": "plot", "role": "style", "valType": "number" } }, "yaxis": { "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, "editType": "plot", "impliedEdits": {}, "role": "style", "valType": "enumerated", "values": [ true, false, "reversed" ] }, "backgroundcolor": { "description": "Sets the background color of this axis' wall.", "dflt": "rgba(204, 204, 204, 0.5)", "editType": "plot", "role": "style", "valType": "color" }, "calendar": { "description": "Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar`", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "categoryarraysrc": { "description": "Sets the source reference on plot.ly for categoryarray .", "editType": "none", "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", "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "color" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "none", "e", "E", "power", "SI", "B" ] }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "rgb(204, 204, 204)", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "plot", "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, "editType": "plot", "role": "style", "valType": "enumerated", "values": [ true, "ticks", false, "all", "allticks" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "integer" }, "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "autorange": false }, "items": [ { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" }, { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" } ], "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "normal", "tozero", "nonnegative" ] }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showaxeslabels": { "description": "Sets whether or not this axis is labeled", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "showbackground": { "description": "Sets whether or not this axis' wall has a background color.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "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", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showspikes": { "description": "Sets whether or not spikes starting from data points to this axis' wall are shown on hover.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "spikecolor": { "description": "Sets the color of the spikes.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "spikesides": { "description": "Sets whether or not spikes extending from the projection data points to this axis' wall boundaries are shown on hover.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "spikethickness": { "description": "Sets the thickness (in px) of the spikes.", "dflt": 2, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "plot", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "plot", "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).", "editType": "plot", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "plot", "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 `tickvals`.", "editType": "plot", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "plot", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "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": "-", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "-", "linear", "log", "date", "category" ] }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", "role": "info", "valType": "boolean" }, "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.", "editType": "plot", "role": "style", "valType": "boolean" }, "zerolinecolor": { "description": "Sets the line color of the zero line.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "zerolinewidth": { "description": "Sets the width (in px) of the zero line.", "dflt": 1, "editType": "plot", "role": "style", "valType": "number" } }, "zaxis": { "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, "editType": "plot", "impliedEdits": {}, "role": "style", "valType": "enumerated", "values": [ true, false, "reversed" ] }, "backgroundcolor": { "description": "Sets the background color of this axis' wall.", "dflt": "rgba(204, 204, 204, 0.5)", "editType": "plot", "role": "style", "valType": "color" }, "calendar": { "description": "Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar`", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "categoryarraysrc": { "description": "Sets the source reference on plot.ly for categoryarray .", "editType": "none", "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", "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "color" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "none", "e", "E", "power", "SI", "B" ] }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "rgb(204, 204, 204)", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "plot", "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, "editType": "plot", "role": "style", "valType": "enumerated", "values": [ true, "ticks", false, "all", "allticks" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "integer" }, "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "autorange": false }, "items": [ { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" }, { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" } ], "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "normal", "tozero", "nonnegative" ] }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showaxeslabels": { "description": "Sets whether or not this axis is labeled", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "showbackground": { "description": "Sets whether or not this axis' wall has a background color.", "dflt": false, "editType": "plot", "role": "info", "valType": "boolean" }, "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", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showspikes": { "description": "Sets whether or not spikes starting from data points to this axis' wall are shown on hover.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "spikecolor": { "description": "Sets the color of the spikes.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "spikesides": { "description": "Sets whether or not spikes extending from the projection data points to this axis' wall boundaries are shown on hover.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "spikethickness": { "description": "Sets the thickness (in px) of the spikes.", "dflt": 2, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "plot", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "plot", "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).", "editType": "plot", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "plot", "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 `tickvals`.", "editType": "plot", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "plot", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "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": "-", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "-", "linear", "log", "date", "category" ] }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", "role": "info", "valType": "boolean" }, "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.", "editType": "plot", "role": "style", "valType": "boolean" }, "zerolinecolor": { "description": "Sets the line color of the zero line.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "zerolinewidth": { "description": "Sets the width (in px) of the zero line.", "dflt": 1, "editType": "plot", "role": "style", "valType": "number" } } }, "separators": { "description": "Sets the decimal and thousand separators. For example, *. * puts a '.' before decimals and a space between thousands.", "dflt": ".,", "editType": "plot", "role": "style", "valType": "string" }, "shapes": { "items": { "shape": { "editType": "arraydraw", "fillcolor": { "description": "Sets the color filling the shape's interior.", "dflt": "rgba(0,0,0,0)", "editType": "arraydraw", "role": "info", "valType": "color" }, "layer": { "description": "Specifies whether shapes are drawn below or above traces.", "dflt": "above", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "below", "above" ] }, "line": { "color": { "description": "Sets the line color.", "editType": "arraydraw", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "arraydraw", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "calcIfAutorange", "role": "object", "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" } }, "opacity": { "description": "Sets the opacity of the shape.", "dflt": 1, "editType": "arraydraw", "max": 1, "min": 0, "role": "info", "valType": "number" }, "path": { "description": "For `type` *path* - a valid SVG path but with the pixel values replaced by data values. There are a few restrictions / quirks only absolute instructions, not relative. So the allowed segments are: M, L, H, V, Q, C, T, S, and Z arcs (A) are not allowed because radius rx and ry are relative. In the future we could consider supporting relative commands, but we would have to decide on how to handle date and log axes. Note that even as is, Q and C Bezier paths that are smooth on linear axes may not be smooth on log, and vice versa. no chained \"polybezier\" commands - specify the segment type for each one. On category axes, values are numbers scaled to the serial numbers of categories because using the categories themselves there would be no way to describe fractional positions On data axes: because space and T are both normal components of path strings, we can't use either to separate date from time parts. Therefore we'll use underscore for this purpose: 2015-02-21_13:45:56.789", "editType": "calcIfAutorange", "role": "info", "valType": "string" }, "role": "object", "type": { "description": "Specifies the shape type to be drawn. If *line*, a line is drawn from (`x0`,`y0`) to (`x1`,`y1`) If *circle*, a circle is drawn from ((`x0`+`x1`)/2, (`y0`+`y1`)/2)) with radius (|(`x0`+`x1`)/2 - `x0`|, |(`y0`+`y1`)/2 -`y0`)|) If *rect*, a rectangle is drawn linking (`x0`,`y0`), (`x1`,`y0`), (`x1`,`y1`), (`x0`,`y1`), (`x0`,`y0`) If *path*, draw a custom SVG path using `path`.", "editType": "calcIfAutorange", "role": "info", "valType": "enumerated", "values": [ "circle", "rect", "path", "line" ] }, "visible": { "description": "Determines whether or not this shape is visible.", "dflt": true, "editType": "calcIfAutorange", "role": "info", "valType": "boolean" }, "x0": { "description": "Sets the shape's starting x position. See `type` for more info.", "editType": "calcIfAutorange", "role": "info", "valType": "any" }, "x1": { "description": "Sets the shape's end x position. See `type` for more info.", "editType": "calcIfAutorange", "role": "info", "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. 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.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "paper", "/^x([2-9]|[1-9][0-9]+)?$/" ] }, "y0": { "description": "Sets the shape's starting y position. See `type` for more info.", "editType": "calcIfAutorange", "role": "info", "valType": "any" }, "y1": { "description": "Sets the shape's end y position. See `type` for more info.", "editType": "calcIfAutorange", "role": "info", "valType": "any" }, "yref": { "description": "Sets the annotation's y coordinate axis. If set to an y axis id (e.g. *y* or *y2*), the `y` position refers to an y coordinate If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where *0* (*1*) corresponds to the bottom (top).", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "paper", "/^y([2-9]|[1-9][0-9]+)?$/" ] } } }, "role": "object" }, "showlegend": { "description": "Determines whether or not a legend is drawn.", "editType": "legend", "role": "info", "valType": "boolean" }, "sliders": { "items": { "slider": { "active": { "description": "Determines which button (by index starting from 0) is considered active.", "dflt": 0, "editType": "arraydraw", "min": 0, "role": "info", "valType": "number" }, "activebgcolor": { "description": "Sets the background color of the slider grip while dragging.", "dflt": "#dbdde0", "editType": "arraydraw", "role": "style", "valType": "color" }, "bgcolor": { "description": "Sets the background color of the slider.", "dflt": "#f8fafc", "editType": "arraydraw", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the color of the border enclosing the slider.", "dflt": "#bec8d9", "editType": "arraydraw", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) of the border enclosing the slider.", "dflt": 1, "editType": "arraydraw", "min": 0, "role": "style", "valType": "number" }, "currentvalue": { "editType": "arraydraw", "font": { "color": { "editType": "arraydraw", "role": "style", "valType": "color" }, "description": "Sets the font of the current value label text.", "editType": "arraydraw", "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*.", "editType": "arraydraw", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "arraydraw", "min": 1, "role": "style", "valType": "number" } }, "offset": { "description": "The amount of space, in pixels, between the current value label and the slider.", "dflt": 10, "editType": "arraydraw", "role": "info", "valType": "number" }, "prefix": { "description": "When currentvalue.visible is true, this sets the prefix of the label.", "editType": "arraydraw", "role": "info", "valType": "string" }, "role": "object", "suffix": { "description": "When currentvalue.visible is true, this sets the suffix of the label.", "editType": "arraydraw", "role": "info", "valType": "string" }, "visible": { "description": "Shows the currently-selected value above the slider.", "dflt": true, "editType": "arraydraw", "role": "info", "valType": "boolean" }, "xanchor": { "description": "The alignment of the value readout relative to the length of the slider.", "dflt": "left", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "left", "center", "right" ] } }, "editType": "arraydraw", "font": { "color": { "editType": "arraydraw", "role": "style", "valType": "color" }, "description": "Sets the font of the slider step labels.", "editType": "arraydraw", "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*.", "editType": "arraydraw", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "arraydraw", "min": 1, "role": "style", "valType": "number" } }, "len": { "description": "Sets the length of the slider This measure excludes the padding of both ends. That is, the slider's length is this length minus the padding on both ends.", "dflt": 1, "editType": "arraydraw", "min": 0, "role": "style", "valType": "number" }, "lenmode": { "description": "Determines whether this slider length is set in units of plot *fraction* or in *pixels. Use `len` to set the value.", "dflt": "fraction", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "minorticklen": { "description": "Sets the length in pixels of minor step tick marks", "dflt": 4, "editType": "arraydraw", "min": 0, "role": "style", "valType": "number" }, "pad": { "b": { "description": "The amount of padding (in px) along the bottom of the component.", "dflt": 0, "editType": "arraydraw", "role": "style", "valType": "number" }, "description": "Set the padding of the slider component along each side.", "editType": "arraydraw", "l": { "description": "The amount of padding (in px) on the left side of the component.", "dflt": 0, "editType": "arraydraw", "role": "style", "valType": "number" }, "r": { "description": "The amount of padding (in px) on the right side of the component.", "dflt": 0, "editType": "arraydraw", "role": "style", "valType": "number" }, "role": "object", "t": { "description": "The amount of padding (in px) along the top of the component.", "dflt": 20, "editType": "arraydraw", "role": "style", "valType": "number" } }, "role": "object", "steps": { "items": { "step": { "args": { "description": "Sets the arguments values to be passed to the Plotly method set in `method` on slide.", "editType": "arraydraw", "freeLength": true, "items": [ { "editType": "arraydraw", "valType": "any" }, { "editType": "arraydraw", "valType": "any" }, { "editType": "arraydraw", "valType": "any" } ], "role": "info", "valType": "info_array" }, "editType": "arraydraw", "execute": { "description": "When true, the API method is executed. When false, all other behaviors are the same and command execution is skipped. This may be useful when hooking into, for example, the `plotly_sliderchange` method and executing the API command manually without losing the benefit of the slider automatically binding to the state of the plot through the specification of `method` and `args`.", "dflt": true, "editType": "arraydraw", "role": "info", "valType": "boolean" }, "label": { "description": "Sets the text label to appear on the slider", "editType": "arraydraw", "role": "info", "valType": "string" }, "method": { "description": "Sets the Plotly method to be called when the slider value is changed. If the `skip` method is used, the API slider will function as normal but will perform no API calls and will not bind automatically to state updates. This may be used to create a component interface and attach to slider events manually via JavaScript.", "dflt": "restyle", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "restyle", "relayout", "animate", "update", "skip" ] }, "role": "object", "value": { "description": "Sets the value of the slider step, used to refer to the step programatically. Defaults to the slider label if not provided.", "editType": "arraydraw", "role": "info", "valType": "string" } } }, "role": "object" }, "tickcolor": { "description": "Sets the color of the border enclosing the slider.", "dflt": "#333", "editType": "arraydraw", "role": "style", "valType": "color" }, "ticklen": { "description": "Sets the length in pixels of step tick marks", "dflt": 7, "editType": "arraydraw", "min": 0, "role": "style", "valType": "number" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "arraydraw", "min": 0, "role": "style", "valType": "number" }, "transition": { "duration": { "description": "Sets the duration of the slider transition", "dflt": 150, "editType": "arraydraw", "min": 0, "role": "info", "valType": "number" }, "easing": { "description": "Sets the easing function of the slider transition", "dflt": "cubic-in-out", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "linear", "quad", "cubic", "sin", "exp", "circle", "elastic", "back", "bounce", "linear-in", "quad-in", "cubic-in", "sin-in", "exp-in", "circle-in", "elastic-in", "back-in", "bounce-in", "linear-out", "quad-out", "cubic-out", "sin-out", "exp-out", "circle-out", "elastic-out", "back-out", "bounce-out", "linear-in-out", "quad-in-out", "cubic-in-out", "sin-in-out", "exp-in-out", "circle-in-out", "elastic-in-out", "back-in-out", "bounce-in-out" ] }, "editType": "arraydraw", "role": "object" }, "visible": { "description": "Determines whether or not the slider is visible.", "dflt": true, "editType": "arraydraw", "role": "info", "valType": "boolean" }, "x": { "description": "Sets the x position (in normalized coordinates) of the slider.", "dflt": 0, "editType": "arraydraw", "max": 3, "min": -2, "role": "style", "valType": "number" }, "xanchor": { "description": "Sets the slider's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the range selector.", "dflt": "left", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "auto", "left", "center", "right" ] }, "y": { "description": "Sets the y position (in normalized coordinates) of the slider.", "dflt": 0, "editType": "arraydraw", "max": 3, "min": -2, "role": "style", "valType": "number" }, "yanchor": { "description": "Sets the slider's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the range selector.", "dflt": "top", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "auto", "top", "middle", "bottom" ] } } }, "role": "object" }, "smith": { "dflt": false, "editType": "none", "role": "info", "valType": "enumerated", "values": [ 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", "editType": "plot", "role": "style", "valType": "color" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "none", "e", "E", "power", "SI", "B" ] }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "#eee", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "layer": { "description": "Sets the layer on which this axis is displayed. If *above traces*, this axis is displayed above all the subplot's traces If *below traces*, this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to *false* to show markers and/or text nodes above this axis.", "dflt": "above traces", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "above traces", "below traces" ] }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "plot", "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, "editType": "plot", "min": 0, "role": "info", "valType": "number" }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 6, "editType": "plot", "min": 1, "role": "style", "valType": "integer" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "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", "editType": "plot", "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, "editType": "plot", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": true, "editType": "plot", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "plot", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "plot", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "plot", "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).", "editType": "plot", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "plot", "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 `tickvals`.", "editType": "plot", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "plot", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } } }, "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", "editType": "plot", "role": "style", "valType": "color" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "none", "e", "E", "power", "SI", "B" ] }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "#eee", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "layer": { "description": "Sets the layer on which this axis is displayed. If *above traces*, this axis is displayed above all the subplot's traces If *below traces*, this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to *false* to show markers and/or text nodes above this axis.", "dflt": "above traces", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "above traces", "below traces" ] }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "plot", "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, "editType": "plot", "min": 0, "role": "info", "valType": "number" }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 6, "editType": "plot", "min": 1, "role": "style", "valType": "integer" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "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", "editType": "plot", "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, "editType": "plot", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": true, "editType": "plot", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "plot", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "plot", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "plot", "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).", "editType": "plot", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "plot", "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 `tickvals`.", "editType": "plot", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "plot", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } } }, "bgcolor": { "description": "Set the background color of the subplot", "dflt": "#fff", "editType": "plot", "role": "style", "valType": "color" }, "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", "editType": "plot", "role": "style", "valType": "color" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "none", "e", "E", "power", "SI", "B" ] }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "#eee", "editType": "plot", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "layer": { "description": "Sets the layer on which this axis is displayed. If *above traces*, this axis is displayed above all the subplot's traces If *below traces*, this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to *false* to show markers and/or text nodes above this axis.", "dflt": "above traces", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "above traces", "below traces" ] }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "plot", "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, "editType": "plot", "min": 0, "role": "info", "valType": "number" }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 6, "editType": "plot", "min": 1, "role": "style", "valType": "integer" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "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", "editType": "plot", "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, "editType": "plot", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": true, "editType": "plot", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "plot", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "plot", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "plot", "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).", "editType": "plot", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "plot", "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.", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "plot", "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 `tickvals`.", "editType": "plot", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "plot", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "plot", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } } }, "domain": { "editType": "plot", "role": "object", "x": { "description": "Sets the horizontal domain of this subplot (in plot fraction).", "dflt": [ 0, 1 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "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 ], "editType": "plot", "items": [ { "editType": "plot", "max": 1, "min": 0, "valType": "number" }, { "editType": "plot", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "editType": "plot", "role": "object", "sum": { "description": "The number each triplet should sum to, and the maximum range of each axis", "dflt": 1, "editType": "plot", "min": 0, "role": "info", "valType": "number" } }, "title": { "description": "Sets the plot's title.", "dflt": "Click to enter Plot title", "editType": "layoutstyle", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "layoutstyle", "role": "style", "valType": "color" }, "description": "Sets the title font.", "editType": "layoutstyle", "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*.", "editType": "layoutstyle", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "layoutstyle", "min": 1, "role": "style", "valType": "number" } }, "updatemenus": { "items": { "updatemenu": { "_arrayAttrRegexps": [ {} ], "active": { "description": "Determines which button (by index starting from 0) is considered active.", "dflt": 0, "editType": "arraydraw", "min": -1, "role": "info", "valType": "integer" }, "bgcolor": { "description": "Sets the background color of the update menu buttons.", "editType": "arraydraw", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the color of the border enclosing the update menu.", "dflt": "#BEC8D9", "editType": "arraydraw", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) of the border enclosing the update menu.", "dflt": 1, "editType": "arraydraw", "min": 0, "role": "style", "valType": "number" }, "buttons": { "items": { "button": { "args": { "description": "Sets the arguments values to be passed to the Plotly method set in `method` on click.", "editType": "arraydraw", "freeLength": true, "items": [ { "editType": "arraydraw", "valType": "any" }, { "editType": "arraydraw", "valType": "any" }, { "editType": "arraydraw", "valType": "any" } ], "role": "info", "valType": "info_array" }, "editType": "arraydraw", "execute": { "description": "When true, the API method is executed. When false, all other behaviors are the same and command execution is skipped. This may be useful when hooking into, for example, the `plotly_buttonclicked` method and executing the API command manually without losing the benefit of the updatemenu automatically binding to the state of the plot through the specification of `method` and `args`.", "dflt": true, "editType": "arraydraw", "role": "info", "valType": "boolean" }, "label": { "description": "Sets the text label to appear on the button.", "dflt": "", "editType": "arraydraw", "role": "info", "valType": "string" }, "method": { "description": "Sets the Plotly method to be called on click. If the `skip` method is used, the API updatemenu will function as normal but will perform no API calls and will not bind automatically to state updates. This may be used to create a component interface and attach to updatemenu events manually via JavaScript.", "dflt": "restyle", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "restyle", "relayout", "animate", "update", "skip" ] }, "role": "object" } }, "role": "object" }, "direction": { "description": "Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For `left` and `up`, the buttons will still appear in left-to-right or top-to-bottom order respectively.", "dflt": "down", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "left", "right", "up", "down" ] }, "editType": "arraydraw", "font": { "color": { "editType": "arraydraw", "role": "style", "valType": "color" }, "description": "Sets the font of the update menu button text.", "editType": "arraydraw", "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*.", "editType": "arraydraw", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "arraydraw", "min": 1, "role": "style", "valType": "number" } }, "pad": { "b": { "description": "The amount of padding (in px) along the bottom of the component.", "dflt": 0, "editType": "arraydraw", "role": "style", "valType": "number" }, "description": "Sets the padding around the buttons or dropdown menu.", "editType": "arraydraw", "l": { "description": "The amount of padding (in px) on the left side of the component.", "dflt": 0, "editType": "arraydraw", "role": "style", "valType": "number" }, "r": { "description": "The amount of padding (in px) on the right side of the component.", "dflt": 0, "editType": "arraydraw", "role": "style", "valType": "number" }, "role": "object", "t": { "description": "The amount of padding (in px) along the top of the component.", "dflt": 0, "editType": "arraydraw", "role": "style", "valType": "number" } }, "role": "object", "showactive": { "description": "Highlights active dropdown item or active button if true.", "dflt": true, "editType": "arraydraw", "role": "info", "valType": "boolean" }, "type": { "description": "Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically", "dflt": "dropdown", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "dropdown", "buttons" ] }, "visible": { "description": "Determines whether or not the update menu is visible.", "editType": "arraydraw", "role": "info", "valType": "boolean" }, "x": { "description": "Sets the x position (in normalized coordinates) of the update menu.", "dflt": -0.05, "editType": "arraydraw", "max": 3, "min": -2, "role": "style", "valType": "number" }, "xanchor": { "description": "Sets the update menu's horizontal position anchor. This anchor binds the `x` position to the *left*, *center* or *right* of the range selector.", "dflt": "right", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "auto", "left", "center", "right" ] }, "y": { "description": "Sets the y position (in normalized coordinates) of the update menu.", "dflt": 1, "editType": "arraydraw", "max": 3, "min": -2, "role": "style", "valType": "number" }, "yanchor": { "description": "Sets the update menu's vertical position anchor This anchor binds the `y` position to the *top*, *middle* or *bottom* of the range selector.", "dflt": "top", "editType": "arraydraw", "role": "info", "valType": "enumerated", "values": [ "auto", "top", "middle", "bottom" ] } } }, "role": "object" }, "width": { "description": "Sets the plot's width (in px).", "dflt": 700, "editType": "none", "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*.", "editType": "ticks", "role": "info", "valType": "boolean" } }, "_isSubplotObj": true, "anchor": { "description": "If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to *free*, this axis' position is determined by `position`.", "editType": "plot", "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, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "enumerated", "values": [ true, false, "reversed" ] }, "calendar": { "description": "Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar`", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "categoryarraysrc": { "description": "Sets the source reference on plot.ly for categoryarray .", "editType": "none", "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", "editType": "calc", "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", "editType": "ticks", "role": "style", "valType": "color" }, "constrain": { "description": "If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the *range* (default), or by decreasing the *domain*.", "dflt": "range", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "range", "domain" ] }, "constraintoward": { "description": "If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are *left*, *center* (default), and *right* for x axes, and *top*, *middle* (default), and *bottom* for y axes.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "left", "center", "right", "top", "middle", "bottom" ] }, "domain": { "description": "Sets the domain of this axis (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "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`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "ticks", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "ticks", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "#eee", "editType": "ticks", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "ticks", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "none", "role": "style", "valType": "string" }, "layer": { "description": "Sets the layer on which this axis is displayed. If *above traces*, this axis is displayed above all the subplot's traces If *below traces*, this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to *false* to show markers and/or text nodes above this axis.", "dflt": "above traces", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "above traces", "below traces" ] }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "layoutstyle", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "ticks+layoutstyle", "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, "editType": "ticks+layoutstyle", "role": "style", "valType": "enumerated", "values": [ true, "ticks", false, "all", "allticks" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "ticks", "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.", "editType": "calc", "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, "editType": "plot", "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "autorange": false }, "items": [ { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" }, { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" } ], "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "normal", "tozero", "nonnegative" ] }, "rangeselector": { "activecolor": { "description": "Sets the background color of the active range selector button.", "editType": "plot", "role": "style", "valType": "color" }, "bgcolor": { "description": "Sets the background color of the range selector buttons.", "dflt": "#eee", "editType": "plot", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the color of the border enclosing the range selector.", "dflt": "#444", "editType": "plot", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) of the border enclosing the range selector.", "dflt": 0, "editType": "plot", "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, "editType": "plot", "min": 0, "role": "info", "valType": "number" }, "description": "Sets the specifications for each buttons. By default, a range selector comes with no buttons.", "editType": "plot", "label": { "description": "Sets the text label to appear on the button.", "editType": "plot", "role": "info", "valType": "string" }, "role": "object", "step": { "description": "The unit of measurement that the `count` value will set the range by.", "dflt": "month", "editType": "plot", "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. Month and year *todate* are currently available only for the built-in (Gregorian) calendar.", "dflt": "backward", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "backward", "todate" ] } } }, "role": "object" }, "editType": "plot", "font": { "color": { "editType": "plot", "role": "style", "valType": "color" }, "description": "Sets the font of the range selector button text.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "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*.", "editType": "plot", "role": "info", "valType": "boolean" }, "x": { "description": "Sets the x position (in normalized coordinates) of the range selector.", "editType": "plot", "max": 3, "min": -2, "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", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "auto", "left", "center", "right" ] }, "y": { "description": "Sets the y position (in normalized coordinates) of the range selector.", "editType": "plot", "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", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "auto", "top", "middle", "bottom" ] } }, "rangeslider": { "autorange": { "description": "Determines whether or not the range slider range is computed in relation to the input data. If `range` is provided, then `autorange` is set to *false*.", "dflt": true, "editType": "calc", "role": "style", "valType": "boolean" }, "bgcolor": { "description": "Sets the background color of the range slider.", "dflt": "#fff", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the border color of the range slider.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the border color of the range slider.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "editType": "calc", "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "items": [ { "editType": "calc", "valType": "any" }, { "editType": "calc", "valType": "any" } ], "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, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" } }, "role": "object", "scaleanchor": { "description": "If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: *x*}, xaxis2: {scaleanchor: *y*}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: *x*}, xaxis: {scaleanchor: *y*}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "/^x([2-9]|[1-9][0-9]+)?$/", "/^y([2-9]|[1-9][0-9]+)?$/" ] }, "scaleratio": { "description": "If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal.", "dflt": 1, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "ticks", "role": "style", "valType": "boolean" }, "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", "editType": "ticks", "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.", "editType": "ticks", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": false, "editType": "layoutstyle", "role": "style", "valType": "boolean" }, "showspikes": { "description": "Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest", "dflt": false, "editType": "modebar", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "ticks", "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", "editType": "ticks", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "ticks", "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.", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "top", "bottom", "left", "right" ] }, "spikecolor": { "description": "Sets the spike color. If undefined, will use the series color", "dflt": null, "editType": "none", "role": "style", "valType": "color" }, "spikedash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "dash", "editType": "none", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "spikemode": { "description": "Determines the drawing mode for the spike line If *toaxis*, the line is drawn from the data point to the axis the series is plotted on. If *across*, the line is drawn across the entire plot area, and supercedes *toaxis*. If *marker*, then a marker dot is drawn on the axis the series is plotted on", "dflt": "toaxis", "editType": "none", "flags": [ "toaxis", "across", "marker" ], "role": "style", "valType": "flaglist" }, "spikethickness": { "description": "Sets the width (in px) of the zero line.", "dflt": 3, "editType": "none", "role": "style", "valType": "number" }, "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "ticks", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "ticks", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "ticks", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "ticks", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "ticks", "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*.", "editType": "ticks", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "ticks", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "ticks", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "ticks", "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).", "editType": "ticks", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "ticks", "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.", "editType": "ticks", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "ticks", "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 `tickvals`.", "editType": "ticks", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "ticks", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "ticks", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "ticks", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "ticks", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "ticks", "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*.", "editType": "ticks", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "ticks", "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": "-", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "-", "linear", "log", "date", "category" ] }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", "role": "info", "valType": "boolean" }, "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.", "editType": "ticks", "role": "style", "valType": "boolean" }, "zerolinecolor": { "description": "Sets the line color of the zero line.", "dflt": "#444", "editType": "ticks", "role": "style", "valType": "color" }, "zerolinewidth": { "description": "Sets the width (in px) of the zero line.", "dflt": 1, "editType": "ticks", "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*.", "editType": "ticks", "role": "info", "valType": "boolean" } }, "_isSubplotObj": true, "anchor": { "description": "If set to an opposite-letter axis id (e.g. `x2`, `y`), this axis is bound to the corresponding opposite-letter axis. If set to *free*, this axis' position is determined by `position`.", "editType": "plot", "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, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "enumerated", "values": [ true, false, "reversed" ] }, "calendar": { "description": "Sets the calendar system to use for `range` and `tick0` if this is a date axis. This does not set the calendar for interpreting data on this axis, that's specified in the trace or via the global `layout.calendar`", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "categoryarraysrc": { "description": "Sets the source reference on plot.ly for categoryarray .", "editType": "none", "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", "editType": "calc", "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", "editType": "ticks", "role": "style", "valType": "color" }, "constrain": { "description": "If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines how that happens: by increasing the *range* (default), or by decreasing the *domain*.", "dflt": "range", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "range", "domain" ] }, "constraintoward": { "description": "If this axis needs to be compressed (either due to its own `scaleanchor` and `scaleratio` or those of the other axis), determines which direction we push the originally specified plot area. Options are *left*, *center* (default), and *right* for x axes, and *top*, *middle* (default), and *bottom* for y axes.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "left", "center", "right", "top", "middle", "bottom" ] }, "domain": { "description": "Sets the domain of this axis (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "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`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "ticks", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "ticks", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "gridcolor": { "description": "Sets the color of the grid lines.", "dflt": "#eee", "editType": "ticks", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "ticks", "min": 0, "role": "style", "valType": "number" }, "hoverformat": { "description": "Sets the hover text formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "none", "role": "style", "valType": "string" }, "layer": { "description": "Sets the layer on which this axis is displayed. If *above traces*, this axis is displayed above all the subplot's traces If *below traces*, this axis is displayed below all the subplot's traces, but above the grid lines. Useful when used together with scatter-like traces with `cliponaxis` set to *false* to show markers and/or text nodes above this axis.", "dflt": "above traces", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "above traces", "below traces" ] }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "layoutstyle", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "ticks+layoutstyle", "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, "editType": "ticks+layoutstyle", "role": "style", "valType": "enumerated", "values": [ true, "ticks", false, "all", "allticks" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "ticks", "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.", "editType": "calc", "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, "editType": "plot", "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "plot", "impliedEdits": { "autorange": false }, "items": [ { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" }, { "editType": "plot", "impliedEdits": { "^autorange": false }, "valType": "any" } ], "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "normal", "tozero", "nonnegative" ] }, "role": "object", "scaleanchor": { "description": "If set to another axis id (e.g. `x2`, `y`), the range of this axis changes together with the range of the corresponding axis such that the scale of pixels per unit is in a constant ratio. Both axes are still zoomable, but when you zoom one, the other will zoom the same amount, keeping a fixed midpoint. `constrain` and `constraintoward` determine how we enforce the constraint. You can chain these, ie `yaxis: {scaleanchor: *x*}, xaxis2: {scaleanchor: *y*}` but you can only link axes of the same `type`. The linked axis can have the opposite letter (to constrain the aspect ratio) or the same letter (to match scales across subplots). Loops (`yaxis: {scaleanchor: *x*}, xaxis: {scaleanchor: *y*}` or longer) are redundant and the last constraint encountered will be ignored to avoid possible inconsistent constraints via `scaleratio`.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "/^x([2-9]|[1-9][0-9]+)?$/", "/^y([2-9]|[1-9][0-9]+)?$/" ] }, "scaleratio": { "description": "If this axis is linked to another by `scaleanchor`, this determines the pixel to unit scale ratio. For example, if this value is 10, then every unit on this axis spans 10 times the number of pixels as a unit on the linked axis. Use this for example to create an elevation profile where the vertical scale is exaggerated a fixed amount with respect to the horizontal.", "dflt": 1, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "ticks", "role": "style", "valType": "boolean" }, "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", "editType": "ticks", "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.", "editType": "ticks", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": false, "editType": "layoutstyle", "role": "style", "valType": "boolean" }, "showspikes": { "description": "Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest", "dflt": false, "editType": "modebar", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "ticks", "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", "editType": "ticks", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "ticks", "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.", "editType": "plot", "role": "info", "valType": "enumerated", "values": [ "top", "bottom", "left", "right" ] }, "spikecolor": { "description": "Sets the spike color. If undefined, will use the series color", "dflt": null, "editType": "none", "role": "style", "valType": "color" }, "spikedash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "dash", "editType": "none", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "spikemode": { "description": "Determines the drawing mode for the spike line If *toaxis*, the line is drawn from the data point to the axis the series is plotted on. If *across*, the line is drawn across the entire plot area, and supercedes *toaxis*. If *marker*, then a marker dot is drawn on the axis the series is plotted on", "dflt": "toaxis", "editType": "none", "flags": [ "toaxis", "across", "marker" ], "role": "style", "valType": "flaglist" }, "spikethickness": { "description": "Sets the width (in px) of the zero line.", "dflt": 3, "editType": "none", "role": "style", "valType": "number" }, "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "ticks", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "ticks", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "ticks", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "ticks", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "ticks", "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*.", "editType": "ticks", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "ticks", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "ticks", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "ticks", "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).", "editType": "ticks", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "ticks", "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.", "editType": "ticks", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "ticks", "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 `tickvals`.", "editType": "ticks", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "ticks", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "ticks", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of this axis.", "editType": "ticks", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "ticks", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "ticks", "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*.", "editType": "ticks", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "ticks", "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": "-", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "-", "linear", "log", "date", "category" ] }, "visible": { "description": "A single toggle to hide the axis while preserving interaction like dragging. Default is true when a cheater plot is present on the axis, otherwise false", "editType": "plot", "role": "info", "valType": "boolean" }, "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.", "editType": "ticks", "role": "style", "valType": "boolean" }, "zerolinecolor": { "description": "Sets the line color of the zero line.", "dflt": "#444", "editType": "ticks", "role": "style", "valType": "color" }, "zerolinewidth": { "description": "Sets the width (in px) of the zero line.", "dflt": 1, "editType": "ticks", "role": "style", "valType": "number" } } } }, "traces": { "area": { "attributes": { "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "marker": { "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "opacitysrc": { "description": "Sets the source reference on plot.ly for opacity .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "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", "editType": "style", "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", 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": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "role": "info", "valType": "string" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "r": { "description": "For polar chart only.Sets the radial coordinates.", "editType": "calc", "role": "data", "valType": "data_array" }, "rsrc": { "description": "Sets the source reference on plot.ly for r .", "editType": "none", "role": "info", "valType": "string" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "t": { "description": "For polar chart only.Sets the angular coordinates.", "editType": "calc", "role": "data", "valType": "data_array" }, "tsrc": { "description": "Sets the source reference on plot.ly for t .", "editType": "none", "role": "info", "valType": "string" }, "type": "area", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "meta": {} }, "bar": { "attributes": { "_deprecated": { "bardir": { "description": "Renamed to `orientation`.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "v", "h" ] } }, "base": { "arrayOk": true, "description": "Sets where the bar base is drawn (in position axis units). In *stack* or *relative* barmode, traces that set *base* will be excluded and drawn in *overlay* mode instead.", "dflt": null, "editType": "calc", "role": "info", "valType": "any" }, "basesrc": { "description": "Sets the source reference on plot.ly for base .", "editType": "none", "role": "info", "valType": "string" }, "constraintext": { "description": "Constrain the size of text inside or outside a bar to be no larger than the bar itself.", "dflt": "both", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "inside", "outside", "both", "none" ] }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "dx": { "description": "Sets the x coordinate step. See `x0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "dy": { "description": "Sets the y coordinate step. See `y0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "error_x": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "style", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "style", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "plot", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "style", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "style", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "style", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "plot", "min": 0, "role": "style", "valType": "number" } }, "error_y": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "style", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "style", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "plot", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "style", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "style", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "style", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "plot", "min": 0, "role": "style", "valType": "number" } }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hovertext": { "arrayOk": true, "description": "Sets hover 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. To be seen, trace `hoverinfo` must contain a *text* flag.", "dflt": "", "editType": "style", "role": "info", "valType": "string" }, "hovertextsrc": { "description": "Sets the source reference on plot.ly for hovertext .", "editType": "none", "role": "info", "valType": "string" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "insidetextfont": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used for `text` lying inside the bar.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "line": { "autocolorscale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "dflt": 0, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "offset": { "arrayOk": true, "description": "Shifts the position where the bar is drawn (in position axis units). In *group* barmode, traces that set *offset* will be excluded and drawn in *overlay* mode instead.", "dflt": null, "editType": "calc", "role": "info", "valType": "number" }, "offsetsrc": { "description": "Sets the source reference on plot.ly for offset .", "editType": "none", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "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).", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "v", "h" ] }, "outsidetextfont": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used for `text` lying outside the bar.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "r": { "description": "For polar chart only.Sets the radial coordinates.", "editType": "calc", "role": "data", "valType": "data_array" }, "rsrc": { "description": "Sets the source reference on plot.ly for r .", "editType": "none", "role": "info", "valType": "string" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "t": { "description": "For polar chart only.Sets the angular coordinates.", "editType": "calc", "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. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textfont": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used for `text`.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "textposition": { "arrayOk": true, "description": "Specifies the location of the `text`. *inside* positions `text` inside, next to the bar end (rotated and scaled if needed). *outside* positions `text` outside, next to the bar end (scaled if needed). *auto* positions `text` inside or outside so that `text` size is maximized.", "dflt": "none", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "inside", "outside", "auto", "none" ] }, "textpositionsrc": { "description": "Sets the source reference on plot.ly for textposition .", "editType": "none", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "tsrc": { "description": "Sets the source reference on plot.ly for t .", "editType": "none", "role": "info", "valType": "string" }, "type": "bar", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "width": { "arrayOk": true, "description": "Sets the bar width (in position axis units).", "dflt": null, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "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, "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "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, "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" } }, "layoutAttributes": { "bargap": { "description": "Sets the gap (in plot fraction) between bars of adjacent location coordinates.", "editType": "calc", "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, "editType": "calc", "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 *relative*, the bars are stacked on top of one another, with negative values below the axis, positive values above 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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "stack", "group", "overlay", "relative" ] }, "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": "", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "", "fraction", "percent" ] } }, "meta": { "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." } }, "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, "editType": "calcIfAutorange", "role": "style", "valType": "enumerated", "values": [ true, "sd", false ] }, "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", "editType": "calcIfAutorange", "role": "style", "valType": "enumerated", "values": [ "all", "outliers", "suspectedoutliers", false ] }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "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.", "editType": "style", "role": "style", "valType": "color" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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).", "editType": "calcIfAutorange", "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the color of line bounding the box(es).", "editType": "style", "role": "style", "valType": "color" }, "editType": "plot", "role": "object", "width": { "description": "Sets the width (in px) of line bounding the box(es).", "dflt": 2, "editType": "style", "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 numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "editType": "plot", "line": { "color": { "arrayOk": false, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers 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", "editType": "style", "role": "style", "valType": "color" }, "editType": "style", "outliercolor": { "description": "Sets the border line color of the outlier sample points. Defaults to marker.color", "editType": "style", "role": "style", "valType": "color" }, "outlierwidth": { "description": "Sets the border line width (in px) of the outlier sample points.", "dflt": 1, "editType": "style", "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, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "opacity": { "arrayOk": false, "description": "Sets the marker opacity.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "outliercolor": { "description": "Sets the color of the outlier sample points.", "dflt": "rgba(0, 0, 0, 0)", "editType": "style", "role": "style", "valType": "color" }, "role": "object", "size": { "arrayOk": false, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "plot", "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", 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. For box traces, the name will also be used for the position coordinate, if `x` and `x0` (`y` and `y0` if horizontal) are missing and the position axis is categorical", "editType": "calc+clearAxisTypes", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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).", "editType": "calc+clearAxisTypes", "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", "editType": "calcIfAutorange", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "type": "box", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "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, "editType": "calcIfAutorange", "max": 1, "min": 0, "role": "style", "valType": "number" }, "x": { "description": "Sets the x sample data or coordinates. See overview for more info.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "x0": { "description": "Sets the x coordinate of the box. See overview for more info.", "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the y sample data or coordinates. See overview for more info.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "y0": { "description": "Sets the y coordinate of the box. See overview for more info.", "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" } }, "layoutAttributes": { "boxgap": { "description": "Sets the gap (in plot fraction) between boxes of adjacent location coordinates.", "dflt": 0.3, "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "group", "overlay" ] } }, "meta": { "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." } }, "candlestick": { "attributes": { "close": { "description": "Sets the close values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "closesrc": { "description": "Sets the source reference on plot.ly for close .", "editType": "none", "role": "info", "valType": "string" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "decreasing": { "editType": "style", "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.", "editType": "style", "role": "style", "valType": "color" }, "line": { "color": { "description": "Sets the color of line bounding the box(es).", "dflt": "#FF4136", "editType": "style", "role": "style", "valType": "color" }, "editType": "style", "role": "object", "width": { "description": "Sets the width (in px) of line bounding the box(es).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "name": { "description": "Sets the segment name. The segment name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "role": "object", "showlegend": { "description": "Determines whether or not an item corresponding to this segment is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" } }, "high": { "description": "Sets the high values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "highsrc": { "description": "Sets the source reference on plot.ly for high .", "editType": "none", "role": "info", "valType": "string" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "increasing": { "editType": "style", "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.", "editType": "style", "role": "style", "valType": "color" }, "line": { "color": { "description": "Sets the color of line bounding the box(es).", "dflt": "#3D9970", "editType": "style", "role": "style", "valType": "color" }, "editType": "style", "role": "object", "width": { "description": "Sets the width (in px) of line bounding the box(es).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "name": { "description": "Sets the segment name. The segment name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "role": "object", "showlegend": { "description": "Determines whether or not an item corresponding to this segment is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" } }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "editType": "style", "role": "object", "width": { "description": "Sets the width (in px) of line bounding the box(es). Note that this style setting can also be set per direction via `increasing.line.width` and `decreasing.line.width`.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "low": { "description": "Sets the low values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "lowsrc": { "description": "Sets the source reference on plot.ly for low .", "editType": "none", "role": "info", "valType": "string" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "open": { "description": "Sets the open values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "opensrc": { "description": "Sets the source reference on plot.ly for open .", "editType": "none", "role": "info", "valType": "string" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "arrayOk": true, "description": "Sets hover text elements associated with each sample point. 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 this trace's sample points.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "candlestick", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "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, "editType": "calcIfAutorange", "max": 1, "min": 0, "role": "style", "valType": "number" }, "x": { "description": "Sets the x coordinates. If absent, linear coordinate will be generated.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" } }, "meta": { "description": "The candlestick is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely time). The boxes represent the spread between the `open` and `close` values and the lines represent the spread between the `low` and `high` values Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing candles are drawn in green whereas decreasing are drawn in red." } }, "carpet": { "attributes": { "a": { "description": "An array containing values of the first parameter value", "editType": "calc", "role": "data", "valType": "data_array" }, "a0": { "description": "Alternate to `a`. Builds a linear space of a coordinates. Use with `da` where `a0` is the starting coordinate and `da` the step.", "dflt": 0, "editType": "calc", "role": "info", "valType": "number" }, "aaxis": { "arraydtick": { "description": "The stride between grid lines along the axis", "dflt": 1, "editType": "calc", "min": 1, "role": "info", "valType": "integer" }, "arraytick0": { "description": "The starting index of grid lines along the axis", "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "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, "editType": "calc", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "categoryarraysrc": { "description": "Sets the source reference on plot.ly for categoryarray .", "editType": "none", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "trace", "category ascending", "category descending", "array" ] }, "cheatertype": { "dflt": "value", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "index", "value" ] }, "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.", "editType": "calc", "role": "style", "valType": "color" }, "dtick": { "description": "The stride between grid lines along the axis", "dflt": 1, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "editType": "calc", "endline": { "description": "Determines whether or not a line is drawn at along the final value of this axis. If *true*, the end line is drawn on top of the grid lines.", "editType": "calc", "role": "style", "valType": "boolean" }, "endlinecolor": { "description": "Sets the line color of the end line.", "editType": "calc", "role": "style", "valType": "color" }, "endlinewidth": { "description": "Sets the width (in px) of the end line.", "dflt": 1, "editType": "calc", "role": "style", "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", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "gridcolor": { "description": "Sets the axis line color.", "editType": "calc", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "labelpadding": { "description": "Extra padding between label and the axis", "dflt": 10, "editType": "calc", "role": "style", "valType": "integer" }, "labelprefix": { "description": "Sets a axis label prefix.", "editType": "calc", "role": "style", "valType": "string" }, "labelsuffix": { "description": "Sets a axis label suffix.", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "minorgridcolor": { "description": "Sets the color of the grid lines.", "dflt": "#eee", "editType": "calc", "role": "style", "valType": "color" }, "minorgridcount": { "description": "Sets the number of minor grid ticks per major grid tick", "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "minorgridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "items": [ { "editType": "calc", "valType": "any" }, { "editType": "calc", "valType": "any" } ], "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "normal", "tozero", "nonnegative" ] }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "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, "editType": "calc", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether axis labels are drawn on the low side, the high side, both, or neither side of the axis.", "dflt": "start", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "start", "end", "both", "none" ] }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "smoothing": { "dflt": 1, "editType": "calc", "max": 1.3, "min": 0, "role": "info", "valType": "number" }, "startline": { "description": "Determines whether or not a line is drawn at along the starting value of this axis. If *true*, the start line is drawn on top of the grid lines.", "editType": "calc", "role": "style", "valType": "boolean" }, "startlinecolor": { "description": "Sets the line color of the start line.", "editType": "calc", "role": "style", "valType": "color" }, "startlinewidth": { "description": "Sets the width (in px) of the start line.", "dflt": 1, "editType": "calc", "role": "style", "valType": "number" }, "tick0": { "description": "The starting index of grid lines along the axis", "dflt": 0, "editType": "calc", "min": 0, "role": "info", "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "tickmode": { "dflt": "array", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "title": { "description": "Sets the title of this axis.", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleoffset": { "description": "An additional amount by which to offset the title from the tick labels, given in pixels", "dflt": 10, "editType": "calc", "role": "info", "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": "-", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "-", "linear", "date", "category" ] } }, "asrc": { "description": "Sets the source reference on plot.ly for a .", "editType": "none", "role": "info", "valType": "string" }, "b": { "description": "A two dimensional array of y coordinates at each carpet point.", "editType": "calc", "role": "data", "valType": "data_array" }, "b0": { "description": "Alternate to `b`. Builds a linear space of a coordinates. Use with `db` where `b0` is the starting coordinate and `db` the step.", "dflt": 0, "editType": "calc", "role": "info", "valType": "number" }, "baxis": { "arraydtick": { "description": "The stride between grid lines along the axis", "dflt": 1, "editType": "calc", "min": 1, "role": "info", "valType": "integer" }, "arraytick0": { "description": "The starting index of grid lines along the axis", "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "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, "editType": "calc", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "categoryarraysrc": { "description": "Sets the source reference on plot.ly for categoryarray .", "editType": "none", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "trace", "category ascending", "category descending", "array" ] }, "cheatertype": { "dflt": "value", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "index", "value" ] }, "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.", "editType": "calc", "role": "style", "valType": "color" }, "dtick": { "description": "The stride between grid lines along the axis", "dflt": 1, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "editType": "calc", "endline": { "description": "Determines whether or not a line is drawn at along the final value of this axis. If *true*, the end line is drawn on top of the grid lines.", "editType": "calc", "role": "style", "valType": "boolean" }, "endlinecolor": { "description": "Sets the line color of the end line.", "editType": "calc", "role": "style", "valType": "color" }, "endlinewidth": { "description": "Sets the width (in px) of the end line.", "dflt": 1, "editType": "calc", "role": "style", "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", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "gridcolor": { "description": "Sets the axis line color.", "editType": "calc", "role": "style", "valType": "color" }, "gridwidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "labelpadding": { "description": "Extra padding between label and the axis", "dflt": 10, "editType": "calc", "role": "style", "valType": "integer" }, "labelprefix": { "description": "Sets a axis label prefix.", "editType": "calc", "role": "style", "valType": "string" }, "labelsuffix": { "description": "Sets a axis label suffix.", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "linecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "linewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "minorgridcolor": { "description": "Sets the color of the grid lines.", "dflt": "#eee", "editType": "calc", "role": "style", "valType": "color" }, "minorgridcount": { "description": "Sets the number of minor grid ticks per major grid tick", "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "minorgridwidth": { "description": "Sets the width (in px) of the grid lines.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "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*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "items": [ { "editType": "calc", "valType": "any" }, { "editType": "calc", "valType": "any" } ], "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "normal", "tozero", "nonnegative" ] }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "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, "editType": "calc", "role": "style", "valType": "boolean" }, "showline": { "description": "Determines whether or not a line bounding this axis is drawn.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showticklabels": { "description": "Determines whether axis labels are drawn on the low side, the high side, both, or neither side of the axis.", "dflt": "start", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "start", "end", "both", "none" ] }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "smoothing": { "dflt": 1, "editType": "calc", "max": 1.3, "min": 0, "role": "info", "valType": "number" }, "startline": { "description": "Determines whether or not a line is drawn at along the starting value of this axis. If *true*, the start line is drawn on top of the grid lines.", "editType": "calc", "role": "style", "valType": "boolean" }, "startlinecolor": { "description": "Sets the line color of the start line.", "editType": "calc", "role": "style", "valType": "color" }, "startlinewidth": { "description": "Sets the width (in px) of the start line.", "dflt": 1, "editType": "calc", "role": "style", "valType": "number" }, "tick0": { "description": "The starting index of grid lines along the axis", "dflt": 0, "editType": "calc", "min": 0, "role": "info", "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the tick font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "tickmode": { "dflt": "array", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "title": { "description": "Sets the title of this axis.", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this axis' title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleoffset": { "description": "An additional amount by which to offset the title from the tick labels, given in pixels", "dflt": 10, "editType": "calc", "role": "info", "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": "-", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "-", "linear", "date", "category" ] } }, "bsrc": { "description": "Sets the source reference on plot.ly for b .", "editType": "none", "role": "info", "valType": "string" }, "carpet": { "description": "An identifier for this carpet, so that `scattercarpet` and `scattercontour` traces can specify a carpet plot on which they lie", "editType": "calc", "role": "info", "valType": "string" }, "cheaterslope": { "description": "The shift applied to each successive row of data in creating a cheater plot. Only used if `x` is been ommitted.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "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", "editType": "plot", "role": "style", "valType": "color" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "da": { "description": "Sets the a coordinate step. See `a0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "db": { "description": "Sets the b coordinate step. See `b0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "font": { "color": { "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "description": "The default font used for axis & tick labels on this carpet", "editType": "calc", "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*.", "dflt": "\"Open Sans\", verdana, arial, sans-serif", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "dflt": 12, "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "type": "carpet", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "A two dimensional array of x coordinates at each carpet point. If ommitted, the plot is a cheater plot and the xaxis is hidden by default.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "A two dimensional array of y coordinates at each carpet point.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "The data describing carpet axis layout is set in `y` and (optionally) also `x`. If only `y` is present, `x` the plot is interpreted as a cheater plot and is filled in using the `y` values. `x` and `y` may either be 2D arrays matching with each dimension matching that of `a` and `b`, or they may be 1D arrays with total length equal to that of `a` and `b`." } }, "choropleth": { "attributes": { "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "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", "editType": "calc", "role": "info", "valType": "subplotid" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "calc", "extras": [ "all", "none", "skip" ], "flags": [ "location", "z", "text", "name", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "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", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "locationssrc": { "description": "Sets the source reference on plot.ly for locations .", "editType": "none", "role": "info", "valType": "string" }, "marker": { "editType": "calc", "line": { "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "role": "object" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "arrayOk": true, "description": "Sets the text elements associated with each location.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "choropleth", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "z": { "description": "Sets the color values.", "editType": "calc", "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, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "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, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autocontour": { "description": "Determines whether or not the contour level attributes are 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, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the `z` data are filled in.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "contours": { "coloring": { "description": "Determines the coloring method showing the contour values. If *fill*, coloring is done evenly between each contour level If *heatmap*, a heatmap gradient coloring is applied between each contour level. If *lines*, coloring is done on the contour lines. If *none*, no coloring is applied on this trace.", "dflt": "fill", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "fill", "heatmap", "lines", "none" ] }, "editType": "calc", "end": { "description": "Sets the end contour level value. Must be more than `contours.start`", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "role": "style", "valType": "number" }, "impliedEdits": { "autocontour": false, "role": "object" }, "labelfont": { "color": { "editType": "style", "role": "style", "valType": "color" }, "description": "Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "labelformat": { "description": "Sets the contour label formatting rule using d3 formatting mini-language which is very similar to Python, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format.", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "role": "object", "showlabels": { "description": "Determines whether to label the contour lines with their values.", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showlines": { "description": "Determines whether or not the contour lines are drawn. Has an effect only if `contours.coloring` is set to *fill*.", "dflt": true, "editType": "plot", "role": "style", "valType": "boolean" }, "size": { "description": "Sets the step between each contour level. Must be positive.", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "min": 0, "role": "style", "valType": "number" }, "start": { "description": "Sets the starting contour level value. Must be less than `contours.end`", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "role": "style", "valType": "number" } }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "dx": { "description": "Sets the x coordinate step. See `x0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "xtype": "scaled" }, "role": "info", "valType": "number" }, "dy": { "description": "Sets the y coordinate step. See `y0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "ytype": "scaled" }, "role": "info", "valType": "number" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the color of the contour level. Has no effect if `contours.coloring` is set to *lines*.", "editType": "style+colorbars", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "plot", "role": "object", "smoothing": { "description": "Sets the amount of smoothing for the contour lines, where *0* corresponds to no smoothing.", "dflt": 1, "editType": "plot", "max": 1.3, "min": 0, "role": "style", "valType": "number" }, "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style+colorbars", "min": 0, "role": "style", "valType": "number" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "ncontours": { "description": "Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is *true* or if `contours.size` is missing.", "dflt": 15, "editType": "calc", "min": 1, "role": "style", "valType": "integer" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "description": "Sets the text elements associated with each z value.", "editType": "calc", "role": "data", "valType": "data_array" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "transpose": { "description": "Transposes the z data.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "type": "contour", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "impliedEdits": { "xtype": "array" }, "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, "editType": "calc+clearAxisTypes", "impliedEdits": { "xtype": "scaled" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "xtype": { "description": "If *array*, the heatmap's x coordinates are given by *x* (the default behavior when `x` is provided). If *scaled*, the heatmap's x coordinates are given by *x0* and *dx* (the default behavior when `x` is not provided).", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "impliedEdits": { "ytype": "array" }, "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, "editType": "calc+clearAxisTypes", "impliedEdits": { "ytype": "scaled" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "ytype": { "description": "If *array*, the heatmap's y coordinates are given by *y* (the default behavior when `y` is provided) If *scaled*, the heatmap's y coordinates are given by *y0* and *dy* (the default behavior when `y` is not provided)", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "z": { "description": "Sets the z data.", "editType": "calc", "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, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "The data from which contour lines are computed is set in `z`. Data in `z` must be a {2D array} of numbers. Say that `z` has N rows and M columns, then by default, these N rows correspond to N y coordinates (set in `y` or auto-generated) and the M columns correspond to M x coordinates (set in `x` or auto-generated). By setting `transpose` to *true*, the above behavior is flipped." } }, "contourcarpet": { "attributes": { "a": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "impliedEdits": { "xtype": "array" }, "role": "data", "valType": "data_array" }, "a0": { "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, "editType": "calc+clearAxisTypes", "impliedEdits": { "xtype": "scaled" }, "role": "info", "valType": "any" }, "asrc": { "description": "Sets the source reference on plot.ly for a .", "editType": "none", "role": "info", "valType": "string" }, "atype": { "description": "If *array*, the heatmap's x coordinates are given by *x* (the default behavior when `x` is provided). If *scaled*, the heatmap's x coordinates are given by *x0* and *dx* (the default behavior when `x` is not provided).", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": false, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autocontour": { "description": "Determines whether or not the contour level attributes are 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, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "b": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "impliedEdits": { "ytype": "array" }, "role": "data", "valType": "data_array" }, "b0": { "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, "editType": "calc+clearAxisTypes", "impliedEdits": { "ytype": "scaled" }, "role": "info", "valType": "any" }, "bsrc": { "description": "Sets the source reference on plot.ly for b .", "editType": "none", "role": "info", "valType": "string" }, "btype": { "description": "If *array*, the heatmap's y coordinates are given by *y* (the default behavior when `y` is provided) If *scaled*, the heatmap's y coordinates are given by *y0* and *dy* (the default behavior when `y` is not provided)", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "carpet": { "description": "The `carpet` of the carpet axes on which this contour trace lies", "editType": "calc", "role": "info", "valType": "string" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the `z` data are filled in.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "contours": { "coloring": { "description": "Determines the coloring method showing the contour values. If *fill*, coloring is done evenly between each contour level If *lines*, coloring is done on the contour lines. If *none*, no coloring is applied on this trace.", "dflt": "fill", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "fill", "lines", "none" ] }, "editType": "calc", "end": { "description": "Sets the end contour level value. Must be more than `contours.start`", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "role": "style", "valType": "number" }, "labelfont": { "color": { "editType": "style", "role": "style", "valType": "color" }, "description": "Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "labelformat": { "description": "Sets the contour label formatting rule using d3 formatting mini-language which is very similar to Python, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format.", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "operation": { "description": "Sets the filter operation. *=* keeps items equal to `value` *<* keeps items less than `value` *<=* keeps items less than or equal to `value` *>* keeps items greater than `value` *>=* keeps items greater than or equal to `value` *[]* keeps items inside `value[0]` to value[1]` including both bounds` *()* keeps items inside `value[0]` to value[1]` excluding both bounds` *[)* keeps items inside `value[0]` to value[1]` including `value[0]` but excluding `value[1] *(]* keeps items inside `value[0]` to value[1]` excluding `value[0]` but including `value[1] *][* keeps items outside `value[0]` to value[1]` and equal to both bounds` *)(* keeps items outside `value[0]` to value[1]` *](* keeps items outside `value[0]` to value[1]` and equal to `value[0]` *)[* keeps items outside `value[0]` to value[1]` and equal to `value[1]`", "dflt": "=", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "=", "<", ">=", ">", "<=", "[]", "()", "[)", "(]", "][", ")(", "](", ")[", "{}", "}{" ] }, "role": "object", "showlabels": { "description": "Determines whether to label the contour lines with their values.", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showlines": { "description": "Determines whether or not the contour lines are drawn. Has an effect only if `contours.coloring` is set to *fill*.", "dflt": true, "editType": "plot", "role": "style", "valType": "boolean" }, "size": { "description": "Sets the step between each contour level. Must be positive.", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "min": 0, "role": "style", "valType": "number" }, "start": { "description": "Sets the starting contour level value. Must be less than `contours.end`", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "role": "style", "valType": "number" }, "type": { "description": "If `levels`, the data is represented as a contour plot with multiple levels displayed. If `constraint`, the data is represented as constraints with the invalid region shaded as specified by the `operation` and `value` parameters.", "dflt": "levels", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "levels", "constraint" ] }, "value": { "description": "Sets the value or values by which to filter by. Values are expected to be in the same type as the data linked to *target*. When `operation` is set to one of the inequality values (=,<,>=,>,<=) *value* is expected to be a number or a string. When `operation` is set to one of the interval value ([],(),[),(],][,)(,](,)[) *value* is expected to be 2-item array where the first item is the lower bound and the second item is the upper bound. When `operation`, is set to one of the set value ({},}{) *value* is expected to be an array with as many items as the desired set elements.", "dflt": 0, "editType": "calc", "role": "info", "valType": "any" } }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "da": { "description": "Sets the x coordinate step. See `x0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "xtype": "scaled" }, "role": "info", "valType": "number" }, "db": { "description": "Sets the y coordinate step. See `y0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "ytype": "scaled" }, "role": "info", "valType": "number" }, "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.", "editType": "calc", "role": "style", "valType": "color" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the color of the contour level. Has no if `contours.coloring` is set to *lines*.", "editType": "style", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "plot", "role": "object", "smoothing": { "description": "Sets the amount of smoothing for the contour lines, where *0* corresponds to no smoothing.", "dflt": 1, "editType": "plot", "max": 1.3, "min": 0, "role": "style", "valType": "number" }, "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "mode": { "description": "The mode.", "editType": "calc", "extras": [ "none" ], "flags": [ "lines", "fill" ], "role": "info", "valType": "flaglist" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "ncontours": { "description": "Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is *true* or if `contours.size` is missing.", "dflt": 15, "editType": "calc", "min": 1, "role": "style", "valType": "integer" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "description": "Sets the text elements associated with each z value.", "editType": "calc", "role": "data", "valType": "data_array" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "transpose": { "description": "Transposes the z data.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "type": "contourcarpet", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "z": { "description": "Sets the z data.", "editType": "calc", "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, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "plot", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "plot", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "Plots contours on either the first carpet axis or the carpet axis with a matching `carpet` attribute. Data `z` is interpreted as matching that of the corresponding carpet axis.", "hrName": "contour_carpet" } }, "heatmap": { "attributes": { "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": false, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the `z` data are filled in.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "dx": { "description": "Sets the x coordinate step. See `x0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "xtype": "scaled" }, "role": "info", "valType": "number" }, "dy": { "description": "Sets the y coordinate step. See `y0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "ytype": "scaled" }, "role": "info", "valType": "number" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "description": "Sets the text elements associated with each z value.", "editType": "calc", "role": "data", "valType": "data_array" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "transpose": { "description": "Transposes the z data.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "type": "heatmap", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "impliedEdits": { "xtype": "array" }, "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, "editType": "calc+clearAxisTypes", "impliedEdits": { "xtype": "scaled" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xgap": { "description": "Sets the horizontal gap (in pixels) between bricks.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "xtype": { "description": "If *array*, the heatmap's x coordinates are given by *x* (the default behavior when `x` is provided). If *scaled*, the heatmap's x coordinates are given by *x0* and *dx* (the default behavior when `x` is not provided).", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "impliedEdits": { "ytype": "array" }, "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, "editType": "calc+clearAxisTypes", "impliedEdits": { "ytype": "scaled" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ygap": { "description": "Sets the vertical gap (in pixels) between bricks.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "ytype": { "description": "If *array*, the heatmap's y coordinates are given by *y* (the default behavior when `y` is provided) If *scaled*, the heatmap's y coordinates are given by *y0* and *dy* (the default behavior when `y` is not provided)", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "z": { "description": "Sets the z data.", "editType": "calc", "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, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "plot", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "plot", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zsmooth": { "description": "Picks a smoothing algorithm use to smooth `z` data.", "dflt": false, "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "fast", "best", false ] }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "The data that describes the heatmap value-to-color mapping is set in `z`. Data in `z` can either be a {2D array} of values (ragged or not) or a 1D array of values. In the case where `z` is a {2D array}, say that `z` has N rows and M columns. Then, by default, the resulting heatmap will have N partitions along the y axis and M partitions along the x axis. In other words, the i-th row/ j-th column cell in `z` is mapped to the i-th partition of the y axis (starting from the bottom of the plot) and the j-th partition of the x-axis (starting from the left of the plot). This behavior can be flipped by using `transpose`. Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements. If M (N), then the coordinates correspond to the center of the heatmap cells and the cells have equal width. If M+1 (N+1), then the coordinates correspond to the edges of the heatmap cells. In the case where `z` is a 1D {array}, the x and y coordinates must be provided in `x` and `y` respectively to form data triplets." } }, "heatmapgl": { "attributes": { "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": false, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "calc", "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).", "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "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": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "calc", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "dx": { "description": "Sets the x coordinate step. See `x0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "xtype": "scaled" }, "role": "info", "valType": "number" }, "dy": { "description": "Sets the y coordinate step. See `y0` for more info.", "dflt": 1, "editType": "calc", "impliedEdits": { "ytype": "scaled" }, "role": "info", "valType": "number" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "description": "Sets the text elements associated with each z value.", "editType": "calc", "role": "data", "valType": "data_array" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "transpose": { "description": "Transposes the z data.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "type": "heatmapgl", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc", "impliedEdits": { "xtype": "array" }, "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, "editType": "calc", "impliedEdits": { "xtype": "scaled" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "xtype": { "description": "If *array*, the heatmap's x coordinates are given by *x* (the default behavior when `x` is provided). If *scaled*, the heatmap's x coordinates are given by *x0* and *dx* (the default behavior when `x` is not provided).", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "y": { "description": "Sets the y coordinates.", "editType": "calc", "impliedEdits": { "ytype": "array" }, "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, "editType": "calc", "impliedEdits": { "ytype": "scaled" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "ytype": { "description": "If *array*, the heatmap's y coordinates are given by *y* (the default behavior when `y` is provided) If *scaled*, the heatmap's y coordinates are given by *y0* and *dy* (the default behavior when `y` is not provided)", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "array", "scaled" ] }, "z": { "description": "Sets the z data.", "editType": "calc", "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, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "WebGL version of the heatmap trace type." } }, "histogram": { "attributes": { "_deprecated": { "bardir": { "description": "Renamed to `orientation`.", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "v", "h" ] } }, "autobinx": { "description": "Determines whether or not the x axis bin attributes are picked by an algorithm. Note that this should be set to false if you want to manually set the number of bins using the attributes in xbins.", "dflt": null, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autobiny": { "description": "Determines whether or not the y axis bin attributes are picked by an algorithm. Note that this should be set to false if you want to manually set the number of bins using the attributes in ybins.", "dflt": null, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cumulative": { "currentbin": { "description": "Only applies if cumulative is enabled. Sets whether the current bin is included, excluded, or has half of its value included in the current cumulative value. *include* is the default for compatibility with various other tools, however it introduces a half-bin bias to the results. *exclude* makes the opposite half-bin bias, and *half* removes it.", "dflt": "include", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "include", "exclude", "half" ] }, "direction": { "description": "Only applies if cumulative is enabled. If *increasing* (default) we sum all prior bins, so the result increases from left to right. If *decreasing* we sum later bins so the result decreases from left to right.", "dflt": "increasing", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "increasing", "decreasing" ] }, "editType": "calc", "enabled": { "description": "If true, display the cumulative distribution by summing the binned values. Use the `direction` and `centralbin` attributes to tune the accumulation method. Note: in this mode, the *density* `histnorm` settings behave the same as their equivalents without *density*: ** and *density* both rise to the number of data points, and *probability* and *probability density* both rise to the number of sample points.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "role": "object" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "error_x": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "style", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "style", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "plot", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "style", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "style", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "style", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "plot", "min": 0, "role": "style", "valType": "number" } }, "error_y": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "style", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "style", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "plot", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "style", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "style", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "style", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "plot", "min": 0, "role": "style", "valType": "number" } }, "histfunc": { "description": "Specifies the binning function used for this histogram trace. If *count*, the histogram values are computed by counting the number of values lying inside each bin. If *sum*, *avg*, *min*, *max*, the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.", "dflt": "count", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "count", "sum", "avg", "min", "max" ] }, "histnorm": { "description": "Specifies the type of normalization used for this histogram trace. If **, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If *percent* / *probability*, the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If *density*, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If *probability density*, the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).", "dflt": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "", "percent", "probability", "density", "probability density" ] }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "line": { "autocolorscale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "dflt": 0, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "nbinsx": { "description": "Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "nbinsy": { "description": "Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "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).", "editType": "calc+clearAxisTypes", "role": "info", "valType": "enumerated", "values": [ "v", "h" ] }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "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. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "histogram", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the sample data to be binned on the x axis.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xbins": { "editType": "calc", "end": { "description": "Sets the end value for the x axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" }, "impliedEdits": { "autobinx": false, "role": "object" }, "role": "object", "size": { "description": "Sets the step in-between value each x axis bin.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" }, "start": { "description": "Sets the starting value for the x axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" } }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the sample data to be binned on the y axis.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ybins": { "editType": "calc", "end": { "description": "Sets the end value for the y axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" }, "impliedEdits": { "autobiny": false, "role": "object" }, "role": "object", "size": { "description": "Sets the step in-between value each y axis bin.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" }, "start": { "description": "Sets the starting value for the y axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" } }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" } }, "layoutAttributes": { "bargap": { "description": "Sets the gap (in plot fraction) between bars of adjacent location coordinates.", "editType": "calc", "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, "editType": "calc", "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 *relative*, the bars are stacked on top of one another, with negative values below the axis, positive values above 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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "stack", "group", "overlay", "relative" ] }, "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": "", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "", "fraction", "percent" ] } }, "meta": { "description": "The sample data from which statistics are computed is set in `x` for vertically spanning histograms and in `y` for horizontally spanning histograms. Binning options are set `xbins` and `ybins` respectively if no aggregation data is provided." } }, "histogram2d": { "attributes": { "autobinx": { "description": "Determines whether or not the x axis bin attributes are picked by an algorithm. Note that this should be set to false if you want to manually set the number of bins using the attributes in xbins.", "dflt": null, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autobiny": { "description": "Determines whether or not the y axis bin attributes are picked by an algorithm. Note that this should be set to false if you want to manually set the number of bins using the attributes in ybins.", "dflt": null, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": false, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "histfunc": { "description": "Specifies the binning function used for this histogram trace. If *count*, the histogram values are computed by counting the number of values lying inside each bin. If *sum*, *avg*, *min*, *max*, the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.", "dflt": "count", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "count", "sum", "avg", "min", "max" ] }, "histnorm": { "description": "Specifies the type of normalization used for this histogram trace. If **, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If *percent* / *probability*, the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If *density*, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If *probability density*, the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).", "dflt": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "", "percent", "probability", "density", "probability density" ] }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "marker": { "color": { "description": "Sets the aggregation data.", "editType": "calc", "role": "data", "valType": "data_array" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "nbinsx": { "description": "Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "nbinsy": { "description": "Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "type": "histogram2d", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the sample data to be binned on the x axis.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xbins": { "editType": "calc", "end": { "description": "Sets the end value for the x axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" }, "impliedEdits": { "autobinx": false, "role": "object" }, "role": "object", "size": { "description": "Sets the step in-between value each x axis bin.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" }, "start": { "description": "Sets the starting value for the x axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" } }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xgap": { "description": "Sets the horizontal gap (in pixels) between bricks.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the sample data to be binned on the y axis.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ybins": { "editType": "calc", "end": { "description": "Sets the end value for the y axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" }, "impliedEdits": { "autobiny": false, "role": "object" }, "role": "object", "size": { "description": "Sets the step in-between value each y axis bin.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" }, "start": { "description": "Sets the starting value for the y axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" } }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ygap": { "description": "Sets the vertical gap (in pixels) between bricks.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "z": { "description": "Sets the aggregation data.", "editType": "calc", "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, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "plot", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "plot", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zsmooth": { "description": "Picks a smoothing algorithm use to smooth `z` data.", "dflt": false, "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "fast", "best", false ] }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case) or `z` (where `z` represent the 2D distribution and binning set, binning is set by `x` and `y` in this case). The resulting distribution is visualized as a heatmap.", "hrName": "histogram_2d" } }, "histogram2dcontour": { "attributes": { "autobinx": { "description": "Determines whether or not the x axis bin attributes are picked by an algorithm. Note that this should be set to false if you want to manually set the number of bins using the attributes in xbins.", "dflt": null, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autobiny": { "description": "Determines whether or not the y axis bin attributes are picked by an algorithm. Note that this should be set to false if you want to manually set the number of bins using the attributes in ybins.", "dflt": null, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "autocontour": { "description": "Determines whether or not the contour level attributes are 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, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "contours": { "coloring": { "description": "Determines the coloring method showing the contour values. If *fill*, coloring is done evenly between each contour level If *heatmap*, a heatmap gradient coloring is applied between each contour level. If *lines*, coloring is done on the contour lines. If *none*, no coloring is applied on this trace.", "dflt": "fill", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "fill", "heatmap", "lines", "none" ] }, "editType": "calc", "end": { "description": "Sets the end contour level value. Must be more than `contours.start`", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "role": "style", "valType": "number" }, "impliedEdits": { "autocontour": false, "role": "object" }, "labelfont": { "color": { "editType": "style", "role": "style", "valType": "color" }, "description": "Sets the font used for labeling the contour levels. The default color comes from the lines, if shown. The default family and size come from `layout.font`.", "editType": "plot", "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*.", "editType": "plot", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "plot", "min": 1, "role": "style", "valType": "number" } }, "labelformat": { "description": "Sets the contour label formatting rule using d3 formatting mini-language which is very similar to Python, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format.", "dflt": "", "editType": "plot", "role": "style", "valType": "string" }, "role": "object", "showlabels": { "description": "Determines whether to label the contour lines with their values.", "dflt": false, "editType": "plot", "role": "style", "valType": "boolean" }, "showlines": { "description": "Determines whether or not the contour lines are drawn. Has an effect only if `contours.coloring` is set to *fill*.", "dflt": true, "editType": "plot", "role": "style", "valType": "boolean" }, "size": { "description": "Sets the step between each contour level. Must be positive.", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "min": 0, "role": "style", "valType": "number" }, "start": { "description": "Sets the starting contour level value. Must be less than `contours.end`", "dflt": null, "editType": "plot", "impliedEdits": { "^autocontour": false }, "role": "style", "valType": "number" } }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "histfunc": { "description": "Specifies the binning function used for this histogram trace. If *count*, the histogram values are computed by counting the number of values lying inside each bin. If *sum*, *avg*, *min*, *max*, the histogram values are computed using the sum, the average, the minimum or the maximum of the values lying inside each bin respectively.", "dflt": "count", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "count", "sum", "avg", "min", "max" ] }, "histnorm": { "description": "Specifies the type of normalization used for this histogram trace. If **, the span of each bar corresponds to the number of occurrences (i.e. the number of data points lying inside the bins). If *percent* / *probability*, the span of each bar corresponds to the percentage / fraction of occurrences with respect to the total number of sample points (here, the sum of all bin HEIGHTS equals 100% / 1). If *density*, the span of each bar corresponds to the number of occurrences in a bin divided by the size of the bin interval (here, the sum of all bin AREAS equals the total number of sample points). If *probability density*, the area of each bar corresponds to the probability that an event will fall into the corresponding bin (here, the sum of all bin AREAS equals 1).", "dflt": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "", "percent", "probability", "density", "probability density" ] }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the color of the contour level. Has no effect if `contours.coloring` is set to *lines*.", "editType": "style+colorbars", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "plot", "role": "object", "smoothing": { "description": "Sets the amount of smoothing for the contour lines, where *0* corresponds to no smoothing.", "dflt": 1, "editType": "plot", "max": 1.3, "min": 0, "role": "style", "valType": "number" }, "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style+colorbars", "min": 0, "role": "style", "valType": "number" } }, "marker": { "color": { "description": "Sets the aggregation data.", "editType": "calc", "role": "data", "valType": "data_array" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "nbinsx": { "description": "Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "nbinsy": { "description": "Specifies the maximum number of desired bins. This value will be used in an algorithm that will decide the optimal bin size such that the histogram best visualizes the distribution of the data.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "ncontours": { "description": "Sets the maximum number of contour levels. The actual number of contours will be chosen automatically to be less than or equal to the value of `ncontours`. Has an effect only if `autocontour` is *true* or if `contours.size` is missing.", "dflt": 15, "editType": "calc", "min": 1, "role": "style", "valType": "integer" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "type": "histogram2dcontour", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the sample data to be binned on the x axis.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xbins": { "editType": "calc", "end": { "description": "Sets the end value for the x axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" }, "impliedEdits": { "autobinx": false, "role": "object" }, "role": "object", "size": { "description": "Sets the step in-between value each x axis bin.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" }, "start": { "description": "Sets the starting value for the x axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobinx": false }, "role": "style", "valType": "any" } }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the sample data to be binned on the y axis.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ybins": { "editType": "calc", "end": { "description": "Sets the end value for the y axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" }, "impliedEdits": { "autobiny": false, "role": "object" }, "role": "object", "size": { "description": "Sets the step in-between value each y axis bin.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" }, "start": { "description": "Sets the starting value for the y axis bins.", "dflt": null, "editType": "calc", "impliedEdits": { "^autobiny": false }, "role": "style", "valType": "any" } }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "z": { "description": "Sets the aggregation data.", "editType": "calc", "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, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "The sample data from which statistics are computed is set in `x` and `y` (where `x` and `y` represent marginal distributions, binning is set in `xbins` and `ybins` in this case) or `z` (where `z` represent the 2D distribution and binning set, binning is set by `x` and `y` in this case). The resulting distribution is visualized as a contour plot.", "hrName": "histogram_2d_contour" } }, "mesh3d": { "attributes": { "alphahull": { "description": "Determines how the mesh surface triangles are derived from the set of vertices (points) represented by the `x`, `y` and `z` arrays, if the `i`, `j`, `k` arrays are not supplied. For general use of `mesh3d` it is preferred that `i`, `j`, `k` are supplied. If *-1*, Delaunay triangulation is used, which is mainly suitable if the mesh is a single, more or less layer surface that is perpendicular to `delaunayaxis`. In case the `delaunayaxis` intersects the mesh surface at more than one point it will result triangles that are very long in the dimension of `delaunayaxis`. If *>0*, the alpha-shape algorithm is used. In this case, the positive `alphahull` value signals the use of the alpha-shape algorithm, _and_ its value acts as the parameter for the mesh fitting. If *0*, the convex-hull algorithm is used. It is suitable for convex bodies or if the intention is to enclose the `x`, `y` and `z` point set into a convex hull.", "dflt": -1, "editType": "calc", "role": "style", "valType": "number" }, "autocolorscale": { "description": "Has an effect only if `color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": false, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "cmax": { "description": "Has an effect only if `color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `color` array index, and if set, `cmin` must be set as well.", "dflt": null, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "cmin": { "description": "Has an effect only if `color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `color` array index, and if set, `cmax` must be set as well.", "dflt": null, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "description": "Sets the color of the whole mesh", "editType": "calc", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" } }, "colorscale": { "description": "Sets the colorscale and only has an effect if `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 `cmin` and `cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "contour": { "color": { "description": "Sets the color of the contour lines.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "role": "object", "show": { "description": "Sets whether or not dynamic contours are shown on hover", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width of the contour lines.", "dflt": 2, "editType": "calc", "max": 16, "min": 1, "role": "style", "valType": "number" } }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "delaunayaxis": { "description": "Sets the Delaunay axis, which is the axis that is perpendicular to the surface of the Delaunay triangulation. It has an effect if `i`, `j`, `k` are not provided and `alphahull` is set to indicate Delaunay triangulation.", "dflt": "z", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "x", "y", "z" ] }, "facecolor": { "description": "Sets the color of each face Overrides *color* and *vertexcolor*.", "editType": "calc", "role": "data", "valType": "data_array" }, "facecolorsrc": { "description": "Sets the source reference on plot.ly for facecolor .", "editType": "none", "role": "info", "valType": "string" }, "flatshading": { "description": "Determines whether or not normal smoothing is applied to the meshes, creating meshes with an angular, low-poly look via flat reflections.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "i": { "description": "A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the *first* vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `i[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `i` represents a point in space, which is the first vertex of a triangle.", "editType": "calc", "role": "data", "valType": "data_array" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "intensity": { "description": "Sets the vertex intensity values, used for plotting fields on meshes", "editType": "calc", "role": "data", "valType": "data_array" }, "intensitysrc": { "description": "Sets the source reference on plot.ly for intensity .", "editType": "none", "role": "info", "valType": "string" }, "isrc": { "description": "Sets the source reference on plot.ly for i .", "editType": "none", "role": "info", "valType": "string" }, "j": { "description": "A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the *second* vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `j[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `j` represents a point in space, which is the second vertex of a triangle.", "editType": "calc", "role": "data", "valType": "data_array" }, "jsrc": { "description": "Sets the source reference on plot.ly for j .", "editType": "none", "role": "info", "valType": "string" }, "k": { "description": "A vector of vertex indices, i.e. integer values between 0 and the length of the vertex vectors, representing the *third* vertex of a triangle. For example, `{i[m], j[m], k[m]}` together represent face m (triangle m) in the mesh, where `k[m] = n` points to the triplet `{x[n], y[n], z[n]}` in the vertex arrays. Therefore, each element in `k` represents a point in space, which is the third vertex of a triangle.", "editType": "calc", "role": "data", "valType": "data_array" }, "ksrc": { "description": "Sets the source reference on plot.ly for k .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "lighting": { "ambient": { "description": "Ambient light increases overall color visibility but can wash out the image.", "dflt": 0.8, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "diffuse": { "description": "Represents the extent that incident rays are reflected in a range of angles.", "dflt": 0.8, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "editType": "calc", "facenormalsepsilon": { "description": "Epsilon for face normals calculation avoids math issues arising from degenerate geometry.", "dflt": 1e-06, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "fresnel": { "description": "Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine.", "dflt": 0.2, "editType": "calc", "max": 5, "min": 0, "role": "style", "valType": "number" }, "role": "object", "roughness": { "description": "Alters specular reflection; the rougher the surface, the wider and less contrasty the shine.", "dflt": 0.5, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "specular": { "description": "Represents the level that incident rays are reflected in a single direction, causing shine.", "dflt": 0.05, "editType": "calc", "max": 2, "min": 0, "role": "style", "valType": "number" }, "vertexnormalsepsilon": { "description": "Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry.", "dflt": 1e-12, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" } }, "lightposition": { "editType": "calc", "role": "object", "x": { "description": "Numeric vector, representing the X coordinate for each vertex.", "dflt": 100000, "editType": "calc", "max": 100000, "min": -100000, "role": "style", "valType": "number" }, "y": { "description": "Numeric vector, representing the Y coordinate for each vertex.", "dflt": 100000, "editType": "calc", "max": 100000, "min": -100000, "role": "style", "valType": "number" }, "z": { "description": "Numeric vector, representing the Z coordinate for each vertex.", "dflt": 0, "editType": "calc", "max": 100000, "min": -100000, "role": "style", "valType": "number" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the surface.", "dflt": 1, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Has an effect only if `color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "scene": { "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "type": "mesh3d", "uid": { "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "vertexcolor": { "description": "Sets the color of each vertex Overrides *color*.", "editType": "calc", "role": "data", "valType": "data_array" }, "vertexcolorsrc": { "description": "Sets the source reference on plot.ly for vertexcolor .", "editType": "none", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the X coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the Y coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "z": { "description": "Sets the Z coordinates of the vertices. The nth element of vectors `x`, `y` and `z` jointly represent the X, Y and Z coordinates of the nth vertex.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "zcalendar": { "description": "Sets the calendar system to use with `z` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "Draws sets of triangles with coordinates given by three 1-dimensional arrays in `x`, `y`, `z` and (1) a sets of `i`, `j`, `k` indices (2) Delaunay triangulation or (3) the Alpha-shape algorithm or (4) the Convex-hull algorithm" } }, "ohlc": { "attributes": { "close": { "description": "Sets the close values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "closesrc": { "description": "Sets the source reference on plot.ly for close .", "editType": "none", "role": "info", "valType": "string" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "decreasing": { "editType": "style", "line": { "color": { "description": "Sets the line color.", "dflt": "#FF4136", "editType": "style", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "style", "role": "object", "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "name": { "description": "Sets the segment name. The segment name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "role": "object", "showlegend": { "description": "Determines whether or not an item corresponding to this segment is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" } }, "high": { "description": "Sets the high values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "highsrc": { "description": "Sets the source reference on plot.ly for high .", "editType": "none", "role": "info", "valType": "string" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "increasing": { "editType": "style", "line": { "color": { "description": "Sets the line color.", "dflt": "#3D9970", "editType": "style", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "style", "role": "object", "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "name": { "description": "Sets the segment name. The segment name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "role": "object", "showlegend": { "description": "Determines whether or not an item corresponding to this segment is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" } }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*). Note that this style setting can also be set per direction via `increasing.line.dash` and `decreasing.line.dash`.", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "style", "role": "object", "width": { "description": "[object Object] Note that this style setting can also be set per direction via `increasing.line.width` and `decreasing.line.width`.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "low": { "description": "Sets the low values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "lowsrc": { "description": "Sets the source reference on plot.ly for low .", "editType": "none", "role": "info", "valType": "string" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "open": { "description": "Sets the open values.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "opensrc": { "description": "Sets the source reference on plot.ly for open .", "editType": "none", "role": "info", "valType": "string" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "arrayOk": true, "description": "Sets hover text elements associated with each sample point. 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 this trace's sample points.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the width of the open/close tick marks relative to the *x* minimal interval.", "dflt": 0.3, "editType": "calcIfAutorange", "max": 0.5, "min": 0, "role": "style", "valType": "number" }, "type": "ohlc", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates. If absent, linear coordinate will be generated.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" } }, "meta": { "description": "The ohlc (short for Open-High-Low-Close) is a style of financial chart describing open, high, low and close for a given `x` coordinate (most likely time). The tip of the lines represent the `low` and `high` values and the horizontal segments represent the `open` and `close` values. Sample points where the close value is higher (lower) then the open value are called increasing (decreasing). By default, increasing candles are drawn in green whereas decreasing are drawn in red." } }, "parcoords": { "attributes": { "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "dimensions": { "items": { "dimension": { "constraintrange": { "description": "The domain range to which the filter on the dimension is constrained. Must be an array of `[fromValue, toValue]` with finite numbers as elements.", "editType": "calc", "items": [ { "editType": "calc", "valType": "number" }, { "editType": "calc", "valType": "number" } ], "role": "info", "valType": "info_array" }, "description": "The dimensions (variables) of the parallel coordinates chart. 2..60 dimensions are supported.", "editType": "calc", "label": { "description": "The shown name of the dimension.", "editType": "calc", "role": "info", "valType": "string" }, "range": { "description": "The domain range that represents the full, shown axis extent. Defaults to the `values` extent. Must be an array of `[fromValue, toValue]` with finite numbers as elements.", "editType": "calc", "items": [ { "editType": "calc", "valType": "number" }, { "editType": "calc", "valType": "number" } ], "role": "info", "valType": "info_array" }, "role": "object", "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-language which is similar to those of Python. See https://github.com/d3/d3-format/blob/master/README.md#locale_format", "dflt": "3s", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "values": { "description": "Dimension values. `values[n]` represents the value of the `n`th point in the dataset, therefore the `values` vector for all dimensions must be the same (longer vectors will be truncated). Each value must be a finite number.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "valuessrc": { "description": "Sets the source reference on plot.ly for values .", "editType": "none", "role": "info", "valType": "string" }, "visible": { "description": "Shows the dimension when set to `true` (the default). Hides the dimension for `false`.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" } } }, "role": "object" }, "domain": { "editType": "calc", "role": "object", "x": { "description": "Sets the horizontal domain of this `parcoords` trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "y": { "description": "Sets the vertical domain of this `parcoords` trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "labelfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the font for the `dimension` labels.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "autocolorscale": { "description": "Has an effect only if line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed. The default value is false, so that `parcoords` colorscale can default to `Viridis`.", "dflt": false, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "cmax": { "description": "Has an effect only if `line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `line.color` array index, and if set, `line.cmin` must be set as well.", "dflt": null, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "cmin": { "description": "Has an effect only if `line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `line.color` array index, and if set, `line.cmax` must be set as well.", "dflt": null, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" } }, "colorscale": { "description": "Sets the colorscale and only has an effect if `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 `line.cmin` and `line.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "dflt": [ [ 0, "#440154" ], [ 0.06274509803921569, "#48186a" ], [ 0.12549019607843137, "#472d7b" ], [ 0.18823529411764706, "#424086" ], [ 0.25098039215686274, "#3b528b" ], [ 0.3137254901960784, "#33638d" ], [ 0.3764705882352941, "#2c728e" ], [ 0.4392156862745098, "#26828e" ], [ 0.5019607843137255, "#21918c" ], [ 0.5647058823529412, "#1fa088" ], [ 0.6274509803921569, "#28ae80" ], [ 0.6901960784313725, "#3fbc73" ], [ 0.7529411764705882, "#5ec962" ], [ 0.8156862745098039, "#84d44b" ], [ 0.8784313725490196, "#addc30" ], [ 0.9411764705882353, "#d8e219" ], [ 1, "#fde725" ] ], "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "showscale": { "description": "Has an effect only if `line.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "rangefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the font for the `dimension` range values.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the font for the `dimension` tick values.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "type": "parcoords", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "meta": { "description": "Parallel coordinates for multidimensional exploratory data analysis. The samples are specified in `dimensions`. The colors are set in `line.color`." } }, "pie": { "attributes": { "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "direction": { "description": "Specifies the direction at which succeeding sectors follow one another.", "dflt": "counterclockwise", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "clockwise", "counterclockwise" ] }, "dlabel": { "description": "Sets the label step. See `label0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "domain": { "editType": "calc", "role": "object", "x": { "description": "Sets the horizontal domain of this pie trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "y": { "description": "Sets the vertical domain of this pie trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "hole": { "description": "Sets the fraction of the radius to cut out of the pie. Use this to make a donut chart.", "dflt": 0, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "label", "text", "value", "percent", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hovertext": { "arrayOk": true, "description": "Sets hover text elements associated with each sector. If a single string, the same string appears for all data points. If an array of string, the items are mapped in order of this trace's sectors. To be seen, trace `hoverinfo` must contain a *text* flag.", "dflt": "", "editType": "style", "role": "info", "valType": "string" }, "hovertextsrc": { "description": "Sets the source reference on plot.ly for hovertext .", "editType": "none", "role": "info", "valType": "string" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "insidetextfont": { "color": { "editType": "style", "role": "style", "valType": "color" }, "description": "Sets the font used for `textinfo` lying inside the pie.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "label0": { "description": "Alternate to `labels`. Builds a numeric set of labels. Use with `dlabel` where `label0` is the starting label and `dlabel` the step.", "dflt": 0, "editType": "calc", "role": "info", "valType": "number" }, "labels": { "description": "Sets the sector labels.", "editType": "calc", "role": "data", "valType": "data_array" }, "labelssrc": { "description": "Sets the source reference on plot.ly for labels .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "marker": { "colors": { "description": "Sets the color of each sector of this pie chart. If not specified, the default trace color set is used to pick the sector colors.", "editType": "calc", "role": "data", "valType": "data_array" }, "colorssrc": { "description": "Sets the source reference on plot.ly for colors .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "line": { "color": { "arrayOk": true, "description": "Sets the color of the line enclosing each sector.", "dflt": "#444", "editType": "style", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the line enclosing each sector.", "dflt": 0, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "role": "object" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "outsidetextfont": { "color": { "editType": "style", "role": "style", "valType": "color" }, "description": "Sets the font used for `textinfo` lying outside the pie.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "pull": { "arrayOk": true, "description": "Sets the fraction of larger radius to pull the sectors out from the center. This can be a constant to pull all slices apart from each other equally or an array to highlight one or more slices.", "dflt": 0, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "pullsrc": { "description": "Sets the source reference on plot.ly for pull .", "editType": "none", "role": "info", "valType": "string" }, "rotation": { "description": "Instead of the first slice starting at 12 o'clock, rotate to some other angle.", "dflt": 0, "editType": "calc", "max": 360, "min": -360, "role": "style", "valType": "number" }, "scalegroup": { "description": "If there are multiple pies that should be sized according to their totals, link them by providing a non-empty group id here shared by every trace in the same group.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "sort": { "description": "Determines whether or not the sectors are reordered from largest to smallest.", "dflt": true, "editType": "calc", "role": "style", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "description": "Sets text elements associated with each sector. If trace `textinfo` contains a *text* flag, these elements will seen on the chart. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "editType": "calc", "role": "data", "valType": "data_array" }, "textfont": { "color": { "editType": "style", "role": "style", "valType": "color" }, "description": "Sets the font used for `textinfo`.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "textinfo": { "description": "Determines which trace information appear on the graph.", "editType": "calc", "extras": [ "none" ], "flags": [ "label", "text", "value", "percent" ], "role": "info", "valType": "flaglist" }, "textposition": { "arrayOk": true, "description": "Specifies the location of the `textinfo`.", "dflt": "auto", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "inside", "outside", "auto", "none" ] }, "textpositionsrc": { "description": "Sets the source reference on plot.ly for textposition .", "editType": "none", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "pie", "uid": { "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "values": { "description": "Sets the values of the sectors of this pie chart.", "editType": "calc", "role": "data", "valType": "data_array" }, "valuessrc": { "description": "Sets the source reference on plot.ly for values .", "editType": "none", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "layoutAttributes": { "hiddenlabels": { "editType": "calc", "role": "data", "valType": "data_array" }, "hiddenlabelssrc": { "description": "Sets the source reference on plot.ly for hiddenlabels .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "A data visualized by the sectors of the pie is set in `values`. The sector labels are set in `labels`. The sector colors are set in `marker.colors`" } }, "pointcloud": { "attributes": { "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "indices": { "description": "A sequential value, 0..n, supply it to avoid creating this array inside plotting. If specified, it must be a typed `Int32Array` array. Its length must be equal to or greater than the number of points. For the best performance and memory use, create one large `indices` typed array that is guaranteed to be at least as long as the largest number of points during use, and reuse it on each `Plotly.restyle()` call.", "editType": "calc", "role": "data", "valType": "data_array" }, "indicessrc": { "description": "Sets the source reference on plot.ly for indices .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "marker": { "blend": { "description": "Determines if colors are blended together for a translucency effect in case `opacity` is specified as a value less then `1`. Setting `blend` to `true` reduces zoom/pan speed if used with large numbers of points.", "dflt": null, "editType": "calc", "role": "style", "valType": "boolean" }, "border": { "arearatio": { "description": "Specifies what fraction of the marker area is covered with the border.", "dflt": 0, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "color": { "arrayOk": false, "description": "Sets the stroke color. It accepts a specific color. If the color is not fully opaque and there are hundreds of thousands of points, it may cause slower zooming and panning.", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "role": "object" }, "color": { "arrayOk": false, "description": "Sets the marker fill color. It accepts a specific color.If the color is not fully opaque and there are hundreds of thousandsof points, it may cause slower zooming and panning.", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "opacity": { "arrayOk": false, "description": "Sets the marker opacity. The default value is `1` (fully opaque). If the markers are not fully opaque and there are hundreds of thousands of points, it may cause slower zooming and panning. Opacity fades the color even if `blend` is left on `false` even if there is no translucency effect in that case.", "dflt": 1, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "role": "object", "sizemax": { "description": "Sets the maximum size (in px) of the rendered marker points. Effective when the `pointcloud` shows only few points.", "dflt": 20, "editType": "calc", "min": 0.1, "role": "style", "valType": "number" }, "sizemin": { "description": "Sets the minimum size (in px) of the rendered marker points, effective when the `pointcloud` shows a million or more points.", "dflt": 0.5, "editType": "calc", "max": 2, "min": 0.1, "role": "style", "valType": "number" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "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": "", "editType": "calc", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "pointcloud", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xbounds": { "description": "Specify `xbounds` in the shape of `[xMin, xMax] to avoid looping through the `xy` typed array. Use it in conjunction with `xy` and `ybounds` for the performance benefits.", "editType": "calc", "role": "data", "valType": "data_array" }, "xboundssrc": { "description": "Sets the source reference on plot.ly for xbounds .", "editType": "none", "role": "info", "valType": "string" }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "xy": { "description": "Faster alternative to specifying `x` and `y` separately. If supplied, it must be a typed `Float32Array` array that represents points such that `xy[i * 2] = x[i]` and `xy[i * 2 + 1] = y[i]`", "editType": "calc", "role": "data", "valType": "data_array" }, "xysrc": { "description": "Sets the source reference on plot.ly for xy .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ybounds": { "description": "Specify `ybounds` in the shape of `[yMin, yMax] to avoid looping through the `xy` typed array. Use it in conjunction with `xy` and `xbounds` for the performance benefits.", "editType": "calc", "role": "data", "valType": "data_array" }, "yboundssrc": { "description": "Sets the source reference on plot.ly for ybounds .", "editType": "none", "role": "info", "valType": "string" }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "The data visualized as a point cloud set in `x` and `y` using the WebGl plotting engine." } }, "sankey": { "attributes": { "arrangement": { "description": "If value is `snap` (the default), the node arrangement is assisted by automatic snapping of elements to preserve space between nodes specified via `nodepad`. If value is `perpendicular`, the nodes can only move along a line perpendicular to the flow. If value is `freeform`, the nodes can freely move on the plane. If value is `fixed`, the nodes are stationary.", "dflt": "snap", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "snap", "perpendicular", "freeform", "fixed" ] }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "domain": { "editType": "calc", "role": "object", "x": { "description": "Sets the horizontal domain of this `sankey` trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "y": { "description": "Sets the vertical domain of this `sankey` trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "calc", "extras": [ "all", "none", "skip" ], "flags": [ "label", "text", "value", "percent", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "calc", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "calc", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "calc", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "link": { "color": { "arrayOk": true, "description": "Sets the `link` color. It can be a single value, or an array for specifying color for each `link`. If `link.color` is omitted, then by default, a translucent grey link will be used.", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "The links of the Sankey plot.", "editType": "calc", "label": { "description": "The shown name of the link.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "labelsrc": { "description": "Sets the source reference on plot.ly for label .", "editType": "none", "role": "info", "valType": "string" }, "line": { "color": { "arrayOk": true, "description": "Sets the color of the `line` around each `link`.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the `line` around each `link`.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "role": "object", "source": { "description": "An integer number `[0..nodes.length - 1]` that represents the source node.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "sourcesrc": { "description": "Sets the source reference on plot.ly for source .", "editType": "none", "role": "info", "valType": "string" }, "target": { "description": "An integer number `[0..nodes.length - 1]` that represents the target node.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "targetsrc": { "description": "Sets the source reference on plot.ly for target .", "editType": "none", "role": "info", "valType": "string" }, "value": { "description": "A numeric value representing the flow volume value.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "valuesrc": { "description": "Sets the source reference on plot.ly for value .", "editType": "none", "role": "info", "valType": "string" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "node": { "color": { "arrayOk": true, "description": "Sets the `node` color. It can be a single value, or an array for specifying color for each `node`. If `node.color` is omitted, then the default `Plotly` color palette will be cycled through to have a variety of colors. These defaults are not fully opaque, to allow some visibility of what is beneath the node.", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "The nodes of the Sankey plot.", "editType": "calc", "label": { "description": "The shown name of the node.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "labelsrc": { "description": "Sets the source reference on plot.ly for label .", "editType": "none", "role": "info", "valType": "string" }, "line": { "color": { "arrayOk": true, "description": "Sets the color of the `line` around each `node`.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the `line` around each `node`.", "dflt": 0.5, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "pad": { "arrayOk": false, "description": "Sets the padding (in px) between the `nodes`.", "dflt": 20, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "role": "object", "thickness": { "arrayOk": false, "description": "Sets the thickness (in px) of the `nodes`.", "dflt": 20, "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "orientation": { "description": "Sets the orientation of the Sankey diagram.", "dflt": "h", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "v", "h" ] }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "textfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the font for node labels", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "type": "sankey", "uid": { "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "valueformat": { "description": "Sets the value formatting rule using d3 formatting mini-language which is similar to those of Python. See https://github.com/d3/d3-format/blob/master/README.md#locale_format", "dflt": ".3s", "editType": "calc", "role": "style", "valType": "string" }, "valuesuffix": { "description": "Adds a unit to follow the value in the hover tooltip. Add a space if a separation is necessary from the value.", "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "meta": { "description": "Sankey plots for network flow data analysis. The nodes are specified in `nodes` and the links between sources and targets in `links`. The colors are set in `nodes[i].color` and `links[i].color`; otherwise defaults are used." } }, "scatter": { "attributes": { "cliponaxis": { "description": "Determines whether or not markers and text nodes are clipped about the subplot axes. To show markers and text nodes above axis lines and tick labels, make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "dx": { "description": "Sets the x coordinate step. See `x0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "dy": { "description": "Sets the y coordinate step. See `y0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "error_x": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "style", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "style", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "plot", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "style", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "style", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "style", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "plot", "min": 0, "role": "style", "valType": "number" } }, "error_y": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "style", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "style", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "plot", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "style", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "style", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "style", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "plot", "min": 0, "role": "style", "valType": "number" } }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "none", "tozeroy", "tozerox", "tonexty", "tonextx", "toself", "tonext" ] }, "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.", "editType": "style", "role": "style", "valType": "color" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", "editType": "style", "flags": [ "points", "fills" ], "role": "info", "valType": "flaglist" }, "hovertext": { "arrayOk": true, "description": "Sets hover 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. To be seen, trace `hoverinfo` must contain a *text* flag.", "dflt": "", "editType": "style", "role": "info", "valType": "string" }, "hovertextsrc": { "description": "Sets the source reference on plot.ly for hovertext .", "editType": "none", "role": "info", "valType": "string" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the line color.", "editType": "style", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "plot", "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", "editType": "plot", "role": "style", "valType": "enumerated", "values": [ "linear", "spline", "hv", "vh", "hvh", "vhv" ] }, "simplify": { "description": "Simplifies lines by removing nearly-collinear points. When transitioning lines, it may be desirable to disable this so that the number of points along the resulting SVG path is unaffected.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "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, "editType": "plot", "max": 1.3, "min": 0, "role": "style", "valType": "number" }, "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "gradient": { "color": { "arrayOk": true, "description": "Sets the final color of the gradient fill: the center color for radial, the right for horizontal, or the bottom for vertical.", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "type": { "arrayOk": true, "description": "Sets the type of gradient used to fill the markers", "dflt": "none", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "radial", "horizontal", "vertical", "none" ] }, "typesrc": { "description": "Sets the source reference on plot.ly for type .", "editType": "none", "role": "info", "valType": "string" } }, "line": { "autocolorscale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "editType": "style", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "maxdisplayed": { "description": "Sets a maximum number of points to be drawn on the graph. *0* corresponds to no limit.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "opacitysrc": { "description": "Sets the source reference on plot.ly for opacity .", "editType": "none", "role": "info", "valType": "string" }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "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, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "diameter", "area" ] }, "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, "editType": "calc", "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "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", "editType": "style", "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", 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": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "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*.", "editType": "calc", "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.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "r": { "description": "For polar chart only.Sets the radial coordinates.", "editType": "calc", "role": "data", "valType": "data_array" }, "rsrc": { "description": "Sets the source reference on plot.ly for r .", "editType": "none", "role": "info", "valType": "string" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "t": { "description": "For polar chart only.Sets the angular coordinates.", "editType": "calc", "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. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textfont": { "color": { "arrayOk": true, "editType": "style", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the text font.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "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", "editType": "calc", "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 .", "editType": "none", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "tsrc": { "description": "Sets the source reference on plot.ly for t .", "editType": "none", "role": "info", "valType": "string" }, "type": "scatter", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "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, "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "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, "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "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": { "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "error_x": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "calc", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "calc", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "calc", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "error_y": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "calc", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "calc", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "calc", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "error_z": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "calc", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "calc", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "calc", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hovertext": { "arrayOk": true, "description": "Sets text elements associated with each (x,y,z) triplet. 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,z) coordinates. To be seen, trace `hoverinfo` must contain a *text* flag.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "hovertextsrc": { "description": "Sets the source reference on plot.ly for hovertext .", "editType": "none", "role": "info", "valType": "string" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "autocolorscale": { "description": "Has an effect only if `line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "cmax": { "description": "Has an effect only if `line.color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `line.color` array index, and if set, `line.cmin` must be set as well.", "dflt": null, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "cmin": { "description": "Has an effect only if `line.color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `line.color` array index, and if set, `line.cmax` must be set as well.", "dflt": null, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "role": "style", "valType": "color" }, "colorscale": { "description": "Sets the colorscale and only has an effect if `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 `line.cmin` and `line.cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "dash": { "description": "Sets the dash style of the lines.", "dflt": "solid", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "calc", "reversescale": { "description": "Has an effect only if `line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "showscale": { "description": "Has an effect only if `line.color` is set to a numerical array. Determines whether or not a colorbar is displayed.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "calc", "impliedEdits": { "cauto": false }, "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, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "calc", "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).", "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "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": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "calc", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "line": { "autocolorscale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "calc", "impliedEdits": { "cauto": false }, "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, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": false, "description": "Sets the width (in px) of the lines bounding the marker points.", "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "opacity": { "arrayOk": false, "description": "Sets the marker opacity. Note that the marker opacity for scatter3d traces must be a scalar value for performance reasons. To set a blending opacity value (i.e. which is not transparent), set *marker.color* to an rgba color and use its alpha channel.", "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 8, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "diameter", "area" ] }, "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, "editType": "calc", "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "symbol": { "arrayOk": true, "description": "Sets the marker symbol type.", "dflt": "circle", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "circle", "circle-open", "square", "square-open", "diamond", "diamond-open", "cross", "x" ] }, "symbolsrc": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "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": "lines+markers", "editType": "calc", "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.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "projection": { "editType": "calc", "role": "object", "x": { "editType": "calc", "opacity": { "description": "Sets the projection color.", "dflt": 1, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "role": "object", "scale": { "description": "Sets the scale factor determining the size of the projection marker points.", "dflt": 0.6666666666666666, "editType": "calc", "max": 10, "min": 0, "role": "style", "valType": "number" }, "show": { "description": "Sets whether or not projections are shown along the x axis.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" } }, "y": { "editType": "calc", "opacity": { "description": "Sets the projection color.", "dflt": 1, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "role": "object", "scale": { "description": "Sets the scale factor determining the size of the projection marker points.", "dflt": 0.6666666666666666, "editType": "calc", "max": 10, "min": 0, "role": "style", "valType": "number" }, "show": { "description": "Sets whether or not projections are shown along the y axis.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" } }, "z": { "editType": "calc", "opacity": { "description": "Sets the projection color.", "dflt": 1, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "role": "object", "scale": { "description": "Sets the scale factor determining the size of the projection marker points.", "dflt": 0.6666666666666666, "editType": "calc", "max": 10, "min": 0, "role": "style", "valType": "number" }, "show": { "description": "Sets whether or not projections are shown along the z axis.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" } } }, "scene": { "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "surfaceaxis": { "description": "If *-1*, the scatter points are not fill with a surface If *0*, *1*, *2*, the scatter points are filled with a Delaunay surface about the x, y, z respectively.", "dflt": -1, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ -1, 0, 1, 2 ] }, "surfacecolor": { "description": "Sets the surface fill color.", "editType": "calc", "role": "style", "valType": "color" }, "text": { "arrayOk": true, "description": "Sets text elements associated with each (x,y,z) triplet. 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,z) coordinates. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textfont": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the text font.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "textposition": { "arrayOk": true, "description": "Sets the positions of the `text` elements with respects to the (x,y) coordinates.", "dflt": "top center", "editType": "calc", "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 .", "editType": "none", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "scatter3d", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "z": { "description": "Sets the z coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "zcalendar": { "description": "Sets the calendar system to use with `z` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "description": "The data visualized as scatter point or lines in 3D dimension is set in `x`, `y`, `z`. 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` Projections are achieved via `projection`. Surface fills are achieved via `surfaceaxis`.", "hrName": "scatter_3d" } }, "scattercarpet": { "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "asrc": { "description": "Sets the source reference on plot.ly for a .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "bsrc": { "description": "Sets the source reference on plot.ly for b .", "editType": "none", "role": "info", "valType": "string" }, "carpet": { "description": "An identifier for this carpet, so that `scattercarpet` and `scattercontour` traces can specify a carpet plot on which they lie", "editType": "calc", "role": "info", "valType": "string" }, "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "fill": { "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "none", "toself", "tonext" ] }, "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.", "editType": "style", "role": "style", "valType": "color" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "a", "b", "text", "name", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", "editType": "style", "flags": [ "points", "fills" ], "role": "info", "valType": "flaglist" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the line color.", "editType": "style", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "calc", "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", "editType": "plot", "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, "editType": "plot", "max": 1.3, "min": 0, "role": "style", "valType": "number" }, "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "gradient": { "color": { "arrayOk": true, "description": "Sets the final color of the gradient fill: the center color for radial, the right for horizontal, or the bottom for vertical.", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "type": { "arrayOk": true, "description": "Sets the type of gradient used to fill the markers", "dflt": "none", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "radial", "horizontal", "vertical", "none" ] }, "typesrc": { "description": "Sets the source reference on plot.ly for type .", "editType": "none", "role": "info", "valType": "string" } }, "line": { "autocolorscale": { "description": "Has an effect only if `color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "cmax": { "description": "Has an effect only if `color` is set to a numerical array. Sets the upper bound of the color domain. Value should be associated to the `color` array index, and if set, `cmin` must be set as well.", "dflt": null, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "cmin": { "description": "Has an effect only if `color` is set to a numerical array. Sets the lower bound of the color domain. Value should be associated to the `color` array index, and if set, `cmax` must be set as well.", "dflt": null, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "colorscale": { "description": "Sets the colorscale and only has an effect if `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 `cmin` and `cmax`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "editType": "style", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "maxdisplayed": { "description": "Sets a maximum number of points to be drawn on the graph. *0* corresponds to no limit.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "opacitysrc": { "description": "Sets the source reference on plot.ly for opacity .", "editType": "none", "role": "info", "valType": "string" }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "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, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "diameter", "area" ] }, "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, "editType": "calc", "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "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", "editType": "style", "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", 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": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "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", "editType": "calc", "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.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "text": { "arrayOk": true, "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": "", "editType": "calc", "role": "info", "valType": "string" }, "textfont": { "color": { "arrayOk": true, "editType": "style", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the text font.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "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", "editType": "calc", "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 .", "editType": "none", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "scattercarpet", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" } }, "meta": { "description": "Plots a scatter trace on either the first carpet axis or the carpet axis with a matching `carpet` attribute.", "hrName": "scatter_carpet" } }, "scattergeo": { "attributes": { "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "fill": { "description": "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape.", "dflt": "none", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "none", "toself" ] }, "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.", "editType": "calc", "role": "style", "valType": "color" }, "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", "editType": "calc", "role": "info", "valType": "subplotid" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "calc", "extras": [ "all", "none", "skip" ], "flags": [ "lon", "lat", "location", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hovertext": { "arrayOk": true, "description": "Sets hover 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. To be seen, trace `hoverinfo` must contain a *text* flag.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "hovertextsrc": { "description": "Sets the source reference on plot.ly for hovertext .", "editType": "none", "role": "info", "valType": "string" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "lat": { "description": "Sets the latitude coordinates (in degrees North).", "editType": "calc", "role": "data", "valType": "data_array" }, "latsrc": { "description": "Sets the source reference on plot.ly for lat .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the line color.", "editType": "calc", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "calc", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "calc", "role": "object", "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "locationmode": { "description": "Determines the set of locations used to match entries in `locations` to regions on the map.", "dflt": "ISO-3", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "ISO-3", "USA-states", "country names" ] }, "locations": { "description": "Sets the coordinates via location IDs or names. Coordinates correspond to the centroid of each location given. See `locationmode` for more info.", "editType": "calc", "role": "data", "valType": "data_array" }, "locationssrc": { "description": "Sets the source reference on plot.ly for locations .", "editType": "none", "role": "info", "valType": "string" }, "lon": { "description": "Sets the longitude coordinates (in degrees East).", "editType": "calc", "role": "data", "valType": "data_array" }, "lonsrc": { "description": "Sets the source reference on plot.ly for lon .", "editType": "none", "role": "info", "valType": "string" }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "calc", "impliedEdits": { "cauto": false }, "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, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "calc", "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).", "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "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": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "calc", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "gradient": { "color": { "arrayOk": true, "description": "Sets the final color of the gradient fill: the center color for radial, the right for horizontal, or the bottom for vertical.", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "type": { "arrayOk": true, "description": "Sets the type of gradient used to fill the markers", "dflt": "none", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "radial", "horizontal", "vertical", "none" ] }, "typesrc": { "description": "Sets the source reference on plot.ly for type .", "editType": "none", "role": "info", "valType": "string" } }, "line": { "autocolorscale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "calc", "impliedEdits": { "cauto": false }, "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, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "opacitysrc": { "description": "Sets the source reference on plot.ly for opacity .", "editType": "none", "role": "info", "valType": "string" }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "diameter", "area" ] }, "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, "editType": "calc", "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "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", "editType": "calc", "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", 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": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "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", "editType": "calc", "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.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "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. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textfont": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the text font.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "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", "editType": "calc", "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 .", "editType": "none", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "scattergeo", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "meta": { "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": { "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "dx": { "description": "Sets the x coordinate step. See `x0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "dy": { "description": "Sets the y coordinate step. See `y0` for more info.", "dflt": 1, "editType": "calc", "role": "info", "valType": "number" }, "error_x": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "calc", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "calc", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "calc", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "error_y": { "_deprecated": { "opacity": { "description": "Obsolete. Use the alpha channel in error bar `color` to set the opacity.", "editType": "calc", "role": "style", "valType": "number" } }, "array": { "description": "Sets the data corresponding the length of each error bar. Values are plotted relative to the underlying data.", "editType": "calc", "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.", "editType": "calc", "role": "data", "valType": "data_array" }, "arrayminussrc": { "description": "Sets the source reference on plot.ly for arrayminus .", "editType": "none", "role": "info", "valType": "string" }, "arraysrc": { "description": "Sets the source reference on plot.ly for array .", "editType": "none", "role": "info", "valType": "string" }, "color": { "description": "Sets the stoke color of the error bars.", "editType": "calc", "role": "style", "valType": "color" }, "copy_ystyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "copy_zstyle": { "editType": "calc", "role": "style", "valType": "boolean" }, "editType": "calc", "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.", "editType": "calc", "role": "info", "valType": "boolean" }, "thickness": { "description": "Sets the thickness (in px) of the error bars.", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "traceref": { "dflt": 0, "editType": "calc", "min": 0, "role": "info", "valType": "integer" }, "tracerefminus": { "dflt": 0, "editType": "calc", "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`.", "editType": "calc", "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, "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "visible": { "description": "Determines whether or not this set of error bars is visible.", "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width (in px) of the cross-bar at both ends of the error bars.", "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "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", "editType": "calc", "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.", "editType": "calc", "role": "style", "valType": "color" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the line color.", "editType": "calc", "role": "style", "valType": "color" }, "dash": { "description": "Sets the style of the lines.", "dflt": "solid", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "calc", "role": "object", "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "calc", "impliedEdits": { "cauto": false }, "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, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "calc", "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).", "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "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": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "calc", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "line": { "autocolorscale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "calc", "impliedEdits": { "cauto": false }, "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, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "opacitysrc": { "description": "Sets the source reference on plot.ly for opacity .", "editType": "none", "role": "info", "valType": "string" }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "diameter", "area" ] }, "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, "editType": "calc", "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "symbol": { "arrayOk": true, "description": "Sets the marker symbol type.", "dflt": "circle", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "circle", "square", "diamond", "cross", "x", "triangle-up", "triangle-down", "triangle-left", "triangle-right", "triangle-ne", "triangle-nw", "triangle-se", "triangle-sw", "pentagon", "hexagon", "hexagon2", "star", "diamond-tall", "bowtie", "diamond-x", "cross-thin", "asterisk", "y-up", "y-down", "line-ew", "line-ns", "circle-open", "square-open", "diamond-open", "cross-open", "x-open", "triangle-up-open", "triangle-down-open", "triangle-left-open", "triangle-right-open", "triangle-ne-open", "triangle-nw-open", "triangle-se-open", "triangle-sw-open", "pentagon-open", "hexagon-open", "hexagon2-open", "star-open", "diamond-tall-open", "bowtie-open", "diamond-x-open", "cross-thin-open", "asterisk-open", "y-up-open", "y-down-open", "line-ew-open", "line-ns-open", "circle-cross-open", "circle-x-open", "square-cross-open", "square-x-open" ] }, "symbolsrc": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "role": "info", "valType": "string" } }, "mode": { "description": "Determines the drawing mode for this scatter trace.", "editType": "calc", "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.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "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": "", "editType": "calc", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "scattergl", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "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, "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "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, "editType": "calc+clearAxisTypes", "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "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." } }, "scattermapbox": { "attributes": { "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "fill": { "description": "Sets the area to fill with a solid color. Use with `fillcolor` if not *none*. *toself* connects the endpoints of the trace (or each segment of the trace if it has gaps) into a closed shape.", "dflt": "none", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "none", "toself" ] }, "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.", "editType": "calc", "role": "style", "valType": "color" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "calc", "extras": [ "all", "none", "skip" ], "flags": [ "lon", "lat", "text", "name", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hovertext": { "arrayOk": true, "description": "Sets hover text elements associated with each (lon,lat) 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 (lon,lat) coordinates. To be seen, trace `hoverinfo` must contain a *text* flag.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "hovertextsrc": { "description": "Sets the source reference on plot.ly for hovertext .", "editType": "none", "role": "info", "valType": "string" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "lat": { "description": "Sets the latitude coordinates (in degrees North).", "editType": "calc", "role": "data", "valType": "data_array" }, "latsrc": { "description": "Sets the source reference on plot.ly for lat .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the line color.", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "role": "object", "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "calc", "min": 0, "role": "style", "valType": "number" } }, "lon": { "description": "Sets the longitude coordinates (in degrees East).", "editType": "calc", "role": "data", "valType": "data_array" }, "lonsrc": { "description": "Sets the source reference on plot.ly for lon .", "editType": "none", "role": "info", "valType": "string" }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "calc", "impliedEdits": { "cauto": false }, "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, "editType": "calc", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "calc", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "calc", "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).", "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "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": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "calc", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "opacitysrc": { "description": "Sets the source reference on plot.ly for opacity .", "editType": "none", "role": "info", "valType": "string" }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "diameter", "area" ] }, "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, "editType": "calc", "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "symbol": { "arrayOk": true, "description": "Sets the marker symbol. Full list: https://www.mapbox.com/maki-icons/ Note that the array `marker.color` and `marker.size` are only available for *circle* symbols.", "dflt": "circle", "editType": "calc", "role": "style", "valType": "string" }, "symbolsrc": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "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.", "dflt": "markers", "editType": "calc", "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.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "subplot": { "description": "Sets a reference between this trace's data coordinates and a mapbox subplot. If *mapbox* (the default value), the data refer to `layout.mapbox`. If *mapbox2*, the data refer to `layout.mapbox2`, and so on.", "dflt": "mapbox", "editType": "calc", "role": "info", "valType": "subplotid" }, "text": { "arrayOk": true, "description": "Sets text elements associated with each (lon,lat) 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 (lon,lat) coordinates. If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the icon text font. Has an effect only when `type` is set to *symbol*.", "editType": "calc", "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*.", "dflt": "Open Sans Regular, Arial Unicode MS Regular", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "textposition": { "arrayOk": false, "description": "Sets the positions of the `text` elements with respects to the (x,y) coordinates.", "dflt": "middle center", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top left", "top center", "top right", "middle left", "middle center", "middle right", "bottom left", "bottom center", "bottom right" ] }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "scattermapbox", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "meta": { "description": "The data visualized as scatter point, lines or marker symbols on a Mapbox GL geographic map is provided by longitude/latitude pairs in `lon` and `lat`.", "hrName": "scatter_mapbox" } }, "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "asrc": { "description": "Sets the source reference on plot.ly for a .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "bsrc": { "description": "Sets the source reference on plot.ly for b .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "cliponaxis": { "description": "Determines whether or not markers and text nodes are clipped about the subplot axes. To show markers and text nodes above axis lines and tick labels, make sure to set `xaxis.layer` and `yaxis.layer` to *below traces*.", "dflt": true, "editType": "plot", "role": "info", "valType": "boolean" }, "connectgaps": { "description": "Determines whether or not gaps (i.e. {nan} or missing values) in the provided data arrays are connected.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "csrc": { "description": "Sets the source reference on plot.ly for c .", "editType": "none", "role": "info", "valType": "string" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "fill": { "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "none", "toself", "tonext" ] }, "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.", "editType": "style", "role": "style", "valType": "color" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "a", "b", "c", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "hoveron": { "description": "Do the hover effects highlight individual points (markers or line points) or do they highlight filled regions? If the fill is *toself* or *tonext* and there are no markers or text, then the default is *fills*, otherwise it is *points*.", "editType": "style", "flags": [ "points", "fills" ], "role": "info", "valType": "flaglist" }, "hovertext": { "arrayOk": true, "description": "Sets hover 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). To be seen, trace `hoverinfo` must contain a *text* flag.", "dflt": "", "editType": "style", "role": "info", "valType": "string" }, "hovertextsrc": { "description": "Sets the source reference on plot.ly for hovertext .", "editType": "none", "role": "info", "valType": "string" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "line": { "color": { "description": "Sets the line color.", "editType": "style", "role": "style", "valType": "color" }, "dash": { "description": "Sets the dash style of lines. Set to a dash type string (*solid*, *dot*, *dash*, *longdash*, *dashdot*, or *longdashdot*) or a dash length list in px (eg *5px,10px,2px,2px*).", "dflt": "solid", "editType": "style", "role": "style", "valType": "string", "values": [ "solid", "dot", "dash", "longdash", "dashdot", "longdashdot" ] }, "editType": "calc", "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", "editType": "plot", "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, "editType": "plot", "max": 1.3, "min": 0, "role": "style", "valType": "number" }, "width": { "description": "Sets the line width (in px).", "dflt": 2, "editType": "style", "min": 0, "role": "style", "valType": "number" } }, "marker": { "autocolorscale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "role": "style", "valType": "color" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "colorbars", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "colorbars", "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", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "colorbars", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "colorbars", "role": "style", "valType": "boolean" }, "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "colorbars", "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, "editType": "colorbars", "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", "editType": "colorbars", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "colorbars", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "colorbars", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "colorbars", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "colorbars", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "colorbars", "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).", "editType": "colorbars", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "colorbars", "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": "", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "colorbars", "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 `tickvals`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "colorbars", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "colorbars", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "colorbars", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "colorbars", "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*.", "editType": "colorbars", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "colorbars", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "colorbars", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "colorbars", "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", "editType": "colorbars", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "colorbars", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "gradient": { "color": { "arrayOk": true, "description": "Sets the final color of the gradient fill: the center color for radial, the right for horizontal, or the bottom for vertical.", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "type": { "arrayOk": true, "description": "Sets the type of gradient used to fill the markers", "dflt": "none", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "radial", "horizontal", "vertical", "none" ] }, "typesrc": { "description": "Sets the source reference on plot.ly for type .", "editType": "none", "role": "info", "valType": "string" } }, "line": { "autocolorscale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Determines whether the colorscale is a default palette (`autocolorscale: true`) or the palette determined by `marker.line.colorscale`. In case `colorscale` is unspecified or `autocolorscale` is true, the default palette will be chosen according to whether numbers in the `color` array are all positive, all negative or mixed.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Has an effect only if `marker.line.color` is set to a numerical array and `cmin`, `cmax` are set by the user. In this case, it controls whether the range of colors in `colorscale` is mapped to the range of values in the `color` array (`cauto: true`), or the `cmin`/`cmax` values (`cauto: false`). Defaults to `false` when `cmin`, `cmax` are set by the user.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "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, "editType": "plot", "impliedEdits": { "cauto": false }, "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, "editType": "plot", "impliedEdits": { "cauto": false }, "role": "info", "valType": "number" }, "color": { "arrayOk": true, "description": "Sets the marker.line color. It accepts either a specific color or an array of numbers that are mapped to the colorscale relative to the max and min values of the array or relative to `cmin` and `cmax` if set.", "editType": "style", "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`. Alternatively, `colorscale` may be a palette name string of the following list: Greys, YlGnBu, Greens, YlOrRd, Bluered, RdBu, Reds, Blues, Picnic, Rainbow, Portland, Jet, Hot, Blackbody, Earth, Electric, Viridis", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "reversescale": { "description": "Has an effect only if `marker.line.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "role": "object", "width": { "arrayOk": true, "description": "Sets the width (in px) of the lines bounding the marker points.", "editType": "style", "min": 0, "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "maxdisplayed": { "description": "Sets a maximum number of points to be drawn on the graph. *0* corresponds to no limit.", "dflt": 0, "editType": "plot", "min": 0, "role": "style", "valType": "number" }, "opacity": { "arrayOk": true, "description": "Sets the marker opacity.", "editType": "style", "max": 1, "min": 0, "role": "style", "valType": "number" }, "opacitysrc": { "description": "Sets the source reference on plot.ly for opacity .", "editType": "none", "role": "info", "valType": "string" }, "reversescale": { "description": "Has an effect only if `marker.color` is set to a numerical array. Reverses the color mapping if true (`cmin` will correspond to the last color in the array and `cmax` will correspond to the first color).", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "size": { "arrayOk": true, "description": "Sets the marker size (in px).", "dflt": 6, "editType": "calcIfAutorange", "min": 0, "role": "style", "valType": "number" }, "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, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "diameter", "area" ] }, "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, "editType": "calc", "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" }, "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", "editType": "style", "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", 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": { "description": "Sets the source reference on plot.ly for symbol .", "editType": "none", "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", "editType": "calc", "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.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "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", "editType": "calc", "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, "editType": "calc", "min": 0, "role": "info", "valType": "number" }, "text": { "arrayOk": true, "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). If trace `hoverinfo` contains a *text* flag and *hovertext* is not set, these elements will be seen in the hover labels.", "dflt": "", "editType": "calc", "role": "info", "valType": "string" }, "textfont": { "color": { "arrayOk": true, "editType": "style", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the text font.", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "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", "editType": "calc", "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 .", "editType": "none", "role": "info", "valType": "string" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "scatterternary", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "meta": { "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": { "_deprecated": { "zauto": { "description": "Obsolete. Use `cauto` instead.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "zmax": { "description": "Obsolete. Use `cmax` instead.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "zmin": { "description": "Obsolete. Use `cmin` instead.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" } }, "autocolorscale": { "description": "Determines whether or not the colorscale is picked using the sign of the input z values.", "dflt": false, "editType": "calc", "impliedEdits": {}, "role": "style", "valType": "boolean" }, "cauto": { "description": "Determines the whether or not the color domain is computed with respect to the input data.", "dflt": true, "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "boolean" }, "cmax": { "description": "Sets the upper bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "cmin": { "description": "Sets the lower bound of color domain.", "dflt": null, "editType": "calc", "impliedEdits": { "zauto": false }, "role": "info", "valType": "number" }, "colorbar": { "bgcolor": { "description": "Sets the color of padded area.", "dflt": "rgba(0,0,0,0)", "editType": "calc", "role": "style", "valType": "color" }, "bordercolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "borderwidth": { "description": "Sets the width (in px) or the border enclosing this color bar.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "dtick": { "description": "Sets the step in-between ticks on this axis. Use with `tick0`. Must be a positive number, or special strings available to *log* and *date* axes. 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. *log* has several special values; *L*, where `f` is a positive number, gives ticks linearly spaced in value (but not position). For example `tick0` = 0.1, `dtick` = *L0.5* will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus small digits between, use *D1* (all digits) or *D2* (only 2 and 5). `tick0` is ignored for *D1* and *D2*. 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. *date* also has special values *M* gives ticks spaced by a number of months. `n` must be a positive integer. To set ticks on the 15th of every third month, set `tick0` to *2000-01-15* and `dtick` to *M3*. To set ticks every 4 years, set `dtick` to *M48*", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "editType": "calc", "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", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "fraction", "pixels" ] }, "nticks": { "description": "Specifies the maximum number of ticks for the particular axis. The actual number of ticks will be chosen automatically to be less than or equal to `nticks`. Has an effect only if `tickmode` is set to *auto*.", "dflt": 0, "editType": "calc", "min": 0, "role": "style", "valType": "integer" }, "outlinecolor": { "description": "Sets the axis line color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "outlinewidth": { "description": "Sets the width (in px) of the axis line.", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "role": "object", "separatethousands": { "description": "If \"true\", even 4-digit integers are separated", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticklabels": { "description": "Determines whether or not the tick labels are drawn.", "dflt": true, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "all", "first", "last", "none" ] }, "showticksuffix": { "description": "Same as `showtickprefix` but for tick suffixes.", "dflt": "all", "editType": "calc", "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, "editType": "calc", "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", "editType": "calc", "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) except when `dtick`=*L* (see `dtick` for more info). If the axis `type` is *date*, it should be a date string, like date data. If the axis `type` is *category*, it should be a number, using the scale where each category is assigned a serial number from zero in the order it appears.", "editType": "calc", "impliedEdits": { "tickmode": "linear" }, "role": "style", "valType": "any" }, "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", "editType": "calc", "role": "style", "valType": "angle" }, "tickcolor": { "description": "Sets the tick color.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "tickfont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets the color bar's tick label font", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "tickformat": { "description": "Sets the tick label formatting rule using d3 formatting mini-languages which are very similar to those in Python. For numbers, see: https://github.com/d3/d3-format/blob/master/README.md#locale_format And for dates see: https://github.com/d3/d3-time-format/blob/master/README.md#locale_format We add one item to d3's date formatter: *%{n}f* for fractional seconds with n digits. For example, *2016-10-13 09:15:23.456* with tickformat *%H~%M~%S.%2f* would display *09~15~23.46*", "dflt": "", "editType": "calc", "role": "style", "valType": "string" }, "ticklen": { "description": "Sets the tick length (in px).", "dflt": 5, "editType": "calc", "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).", "editType": "calc", "impliedEdits": {}, "role": "info", "valType": "enumerated", "values": [ "auto", "linear", "array" ] }, "tickprefix": { "description": "Sets a tick label prefix.", "dflt": "", "editType": "calc", "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": "", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "outside", "inside", "" ] }, "ticksuffix": { "description": "Sets a tick label suffix.", "dflt": "", "editType": "calc", "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 `tickvals`.", "editType": "calc", "role": "data", "valType": "data_array" }, "ticktextsrc": { "description": "Sets the source reference on plot.ly for ticktext .", "editType": "none", "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`.", "editType": "calc", "role": "data", "valType": "data_array" }, "tickvalssrc": { "description": "Sets the source reference on plot.ly for tickvals .", "editType": "none", "role": "info", "valType": "string" }, "tickwidth": { "description": "Sets the tick width (in px).", "dflt": 1, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "title": { "description": "Sets the title of the color bar.", "dflt": "Click to enter colorscale title", "editType": "calc", "role": "info", "valType": "string" }, "titlefont": { "color": { "editType": "calc", "role": "style", "valType": "color" }, "description": "Sets this color bar's title font.", "editType": "calc", "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "role": "object", "size": { "editType": "calc", "min": 1, "role": "style", "valType": "number" } }, "titleside": { "description": "Determines the location of the colorbar title with respect to the color bar.", "dflt": "top", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "right", "top", "bottom" ] }, "x": { "description": "Sets the x position of the color bar (in plot fraction).", "dflt": 1.02, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "xpad": { "description": "Sets the amount of padding (in px) along the x direction.", "dflt": 10, "editType": "calc", "min": 0, "role": "style", "valType": "number" }, "y": { "description": "Sets the y position of the color bar (in plot fraction).", "dflt": 0.5, "editType": "calc", "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", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "top", "middle", "bottom" ] }, "ypad": { "description": "Sets the amount of padding (in px) along the y direction.", "dflt": 10, "editType": "calc", "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", "editType": "calc", "impliedEdits": { "autocolorscale": false }, "role": "style", "valType": "colorscale" }, "contours": { "editType": "calc", "role": "object", "x": { "color": { "description": "Sets the color of the contour lines.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "highlight": { "description": "Determines whether or not contour lines about the x dimension are highlighted on hover.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "highlightcolor": { "description": "Sets the color of the highlighted contour lines.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "highlightwidth": { "description": "Sets the width of the highlighted contour lines.", "dflt": 2, "editType": "calc", "max": 16, "min": 1, "role": "style", "valType": "number" }, "project": { "editType": "calc", "role": "object", "x": { "description": "Determines whether or not these contour lines are projected on the x plane. 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, "editType": "calc", "role": "info", "valType": "boolean" }, "y": { "description": "Determines whether or not these contour lines are projected on the y plane. 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, "editType": "calc", "role": "info", "valType": "boolean" }, "z": { "description": "Determines whether or not these contour lines are projected on the z plane. 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, "editType": "calc", "role": "info", "valType": "boolean" } }, "role": "object", "show": { "description": "Determines whether or not contour lines about the x dimension are drawn.", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width of the contour lines.", "dflt": 2, "editType": "calc", "max": 16, "min": 1, "role": "style", "valType": "number" } }, "y": { "color": { "description": "Sets the color of the contour lines.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "highlight": { "description": "Determines whether or not contour lines about the y dimension are highlighted on hover.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "highlightcolor": { "description": "Sets the color of the highlighted contour lines.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "highlightwidth": { "description": "Sets the width of the highlighted contour lines.", "dflt": 2, "editType": "calc", "max": 16, "min": 1, "role": "style", "valType": "number" }, "project": { "editType": "calc", "role": "object", "x": { "description": "Determines whether or not these contour lines are projected on the x plane. 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, "editType": "calc", "role": "info", "valType": "boolean" }, "y": { "description": "Determines whether or not these contour lines are projected on the y plane. 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, "editType": "calc", "role": "info", "valType": "boolean" }, "z": { "description": "Determines whether or not these contour lines are projected on the z plane. 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, "editType": "calc", "role": "info", "valType": "boolean" } }, "role": "object", "show": { "description": "Determines whether or not contour lines about the y dimension are drawn.", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width of the contour lines.", "dflt": 2, "editType": "calc", "max": 16, "min": 1, "role": "style", "valType": "number" } }, "z": { "color": { "description": "Sets the color of the contour lines.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "editType": "calc", "highlight": { "description": "Determines whether or not contour lines about the z dimension are highlighted on hover.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "highlightcolor": { "description": "Sets the color of the highlighted contour lines.", "dflt": "#444", "editType": "calc", "role": "style", "valType": "color" }, "highlightwidth": { "description": "Sets the width of the highlighted contour lines.", "dflt": 2, "editType": "calc", "max": 16, "min": 1, "role": "style", "valType": "number" }, "project": { "editType": "calc", "role": "object", "x": { "description": "Determines whether or not these contour lines are projected on the x plane. 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, "editType": "calc", "role": "info", "valType": "boolean" }, "y": { "description": "Determines whether or not these contour lines are projected on the y plane. 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, "editType": "calc", "role": "info", "valType": "boolean" }, "z": { "description": "Determines whether or not these contour lines are projected on the z plane. 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, "editType": "calc", "role": "info", "valType": "boolean" } }, "role": "object", "show": { "description": "Determines whether or not contour lines about the z dimension are drawn.", "dflt": false, "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "boolean" }, "width": { "description": "Sets the width of the contour lines.", "dflt": 2, "editType": "calc", "max": 16, "min": 1, "role": "style", "valType": "number" } } }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "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, "editType": "calc", "role": "info", "valType": "boolean" }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "lighting": { "ambient": { "description": "Ambient light increases overall color visibility but can wash out the image.", "dflt": 0.8, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "diffuse": { "description": "Represents the extent that incident rays are reflected in a range of angles.", "dflt": 0.8, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "editType": "calc", "fresnel": { "description": "Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine.", "dflt": 0.2, "editType": "calc", "max": 5, "min": 0, "role": "style", "valType": "number" }, "role": "object", "roughness": { "description": "Alters specular reflection; the rougher the surface, the wider and less contrasty the shine.", "dflt": 0.5, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "specular": { "description": "Represents the level that incident rays are reflected in a single direction, causing shine.", "dflt": 0.05, "editType": "calc", "max": 2, "min": 0, "role": "style", "valType": "number" } }, "lightposition": { "editType": "calc", "role": "object", "x": { "description": "Numeric vector, representing the X coordinate for each vertex.", "dflt": 10, "editType": "calc", "max": 100000, "min": -100000, "role": "style", "valType": "number" }, "y": { "description": "Numeric vector, representing the Y coordinate for each vertex.", "dflt": 10000, "editType": "calc", "max": 100000, "min": -100000, "role": "style", "valType": "number" }, "z": { "description": "Numeric vector, representing the Z coordinate for each vertex.", "dflt": 0, "editType": "calc", "max": 100000, "min": -100000, "role": "style", "valType": "number" } }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the surface.", "dflt": 1, "editType": "calc", "max": 1, "min": 0, "role": "style", "valType": "number" }, "reversescale": { "description": "Reverses the colorscale.", "dflt": false, "editType": "calc", "role": "style", "valType": "boolean" }, "scene": { "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", "editType": "calc+clearAxisTypes", "role": "info", "valType": "subplotid" }, "showlegend": { "description": "Determines whether or not an item corresponding to this trace is shown in the legend.", "dflt": true, "editType": "style", "role": "info", "valType": "boolean" }, "showscale": { "description": "Determines whether or not a colorbar is displayed for this trace.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "surfacecolor": { "description": "Sets the surface color values, used for setting a color scale independent of `z`.", "editType": "calc", "role": "data", "valType": "data_array" }, "surfacecolorsrc": { "description": "Sets the source reference on plot.ly for surfacecolor .", "editType": "none", "role": "info", "valType": "string" }, "text": { "description": "Sets the text elements associated with each z value.", "editType": "calc", "role": "data", "valType": "data_array" }, "textsrc": { "description": "Sets the source reference on plot.ly for text .", "editType": "none", "role": "info", "valType": "string" }, "type": "surface", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] }, "x": { "description": "Sets the x coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "xcalendar": { "description": "Sets the calendar system to use with `x` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "xsrc": { "description": "Sets the source reference on plot.ly for x .", "editType": "none", "role": "info", "valType": "string" }, "y": { "description": "Sets the y coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "ycalendar": { "description": "Sets the calendar system to use with `y` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "ysrc": { "description": "Sets the source reference on plot.ly for y .", "editType": "none", "role": "info", "valType": "string" }, "z": { "description": "Sets the z coordinates.", "editType": "calc+clearAxisTypes", "role": "data", "valType": "data_array" }, "zcalendar": { "description": "Sets the calendar system to use with `z` date data.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "zsrc": { "description": "Sets the source reference on plot.ly for z .", "editType": "none", "role": "info", "valType": "string" } }, "meta": { "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`." } }, "table": { "attributes": { "cells": { "align": { "arrayOk": true, "description": "Sets the horizontal alignment of the `text` within the box. Has an effect only if `text` spans more two or more lines (i.e. `text` contains one or more
HTML tags) or if an explicit width is set to override the text width.", "dflt": "center", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "alignsrc": { "description": "Sets the source reference on plot.ly for align .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "fill": { "color": { "arrayOk": true, "description": "Sets the cell fill color. It accepts either a specific color or an array of colors.", "dflt": "white", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object" }, "font": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "format": { "description": "Sets the cell value formatting rule using d3 formatting mini-language which is similar to those of Python. See https://github.com/d3/d3-format/blob/master/README.md#locale_format", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "formatsrc": { "description": "Sets the source reference on plot.ly for format .", "editType": "none", "role": "info", "valType": "string" }, "height": { "description": "The height of cells.", "dflt": 20, "editType": "calc", "role": "style", "valType": "number" }, "line": { "color": { "arrayOk": true, "dflt": "grey", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "width": { "arrayOk": true, "dflt": 1, "editType": "calc", "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "prefix": { "arrayOk": true, "description": "Prefix for cell values.", "dflt": null, "editType": "calc", "role": "style", "valType": "string" }, "prefixsrc": { "description": "Sets the source reference on plot.ly for prefix .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "suffix": { "arrayOk": true, "description": "Suffix for cell values.", "dflt": null, "editType": "calc", "role": "style", "valType": "string" }, "suffixsrc": { "description": "Sets the source reference on plot.ly for suffix .", "editType": "none", "role": "info", "valType": "string" }, "values": { "description": "Cell values. `values[m][n]` represents the value of the `n`th point in column `m`, therefore the `values[m]` vector length for all columns must be the same (longer vectors will be truncated). Each value must be a finite number or a string.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "valuessrc": { "description": "Sets the source reference on plot.ly for values .", "editType": "none", "role": "info", "valType": "string" } }, "columnorder": { "description": "Specifies the rendered order of the data columns; for example, a value `2` at position `0` means that column index `0` in the data will be rendered as the third column, as columns have an index base of zero.", "editType": "calc", "role": "data", "valType": "data_array" }, "columnordersrc": { "description": "Sets the source reference on plot.ly for columnorder .", "editType": "none", "role": "info", "valType": "string" }, "columnwidth": { "arrayOk": true, "description": "The width of columns expressed as a ratio. Columns fill the available width in proportion of their specified column widths.", "dflt": null, "editType": "calc", "role": "style", "valType": "number" }, "columnwidthsrc": { "description": "Sets the source reference on plot.ly for columnwidth .", "editType": "none", "role": "info", "valType": "string" }, "customdata": { "description": "Assigns extra data each datum. This may be useful when listening to hover, click and selection events. Note that, *scatter* traces also appends customdata items in the markers DOM elements", "editType": "calc", "role": "data", "valType": "data_array" }, "customdatasrc": { "description": "Sets the source reference on plot.ly for customdata .", "editType": "none", "role": "info", "valType": "string" }, "domain": { "editType": "calc", "role": "object", "x": { "description": "Sets the horizontal domain of this `table` trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" }, "y": { "description": "Sets the vertical domain of this `table` trace (in plot fraction).", "dflt": [ 0, 1 ], "editType": "calc", "items": [ { "editType": "calc", "max": 1, "min": 0, "valType": "number" }, { "editType": "calc", "max": 1, "min": 0, "valType": "number" } ], "role": "info", "valType": "info_array" } }, "editType": "calc", "header": { "align": { "arrayOk": true, "description": "Sets the horizontal alignment of the `text` within the box. Has an effect only if `text` spans more two or more lines (i.e. `text` contains one or more
HTML tags) or if an explicit width is set to override the text width.", "dflt": "center", "editType": "calc", "role": "style", "valType": "enumerated", "values": [ "left", "center", "right" ] }, "alignsrc": { "description": "Sets the source reference on plot.ly for align .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "fill": { "color": { "arrayOk": true, "description": "Sets the cell fill color. It accepts either a specific color or an array of colors.", "dflt": "white", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object" }, "font": { "color": { "arrayOk": true, "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "", "editType": "calc", "family": { "arrayOk": true, "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*.", "editType": "calc", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "calc", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "format": { "description": "Sets the cell value formatting rule using d3 formatting mini-language which is similar to those of Python. See https://github.com/d3/d3-format/blob/master/README.md#locale_format", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "formatsrc": { "description": "Sets the source reference on plot.ly for format .", "editType": "none", "role": "info", "valType": "string" }, "height": { "description": "The height of cells.", "dflt": 28, "editType": "calc", "role": "style", "valType": "number" }, "line": { "color": { "arrayOk": true, "dflt": "grey", "editType": "calc", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "role": "object", "width": { "arrayOk": true, "dflt": 1, "editType": "calc", "role": "style", "valType": "number" }, "widthsrc": { "description": "Sets the source reference on plot.ly for width .", "editType": "none", "role": "info", "valType": "string" } }, "prefix": { "arrayOk": true, "description": "Prefix for cell values.", "dflt": null, "editType": "calc", "role": "style", "valType": "string" }, "prefixsrc": { "description": "Sets the source reference on plot.ly for prefix .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "suffix": { "arrayOk": true, "description": "Suffix for cell values.", "dflt": null, "editType": "calc", "role": "style", "valType": "string" }, "suffixsrc": { "description": "Sets the source reference on plot.ly for suffix .", "editType": "none", "role": "info", "valType": "string" }, "values": { "description": "Header cell values. `values[m][n]` represents the value of the `n`th point in column `m`, therefore the `values[m]` vector length for all columns must be the same (longer vectors will be truncated). Each value must be a finite number or a string.", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "valuessrc": { "description": "Sets the source reference on plot.ly for values .", "editType": "none", "role": "info", "valType": "string" } }, "hoverinfo": { "arrayOk": true, "description": "Determines which trace information appear on hover. If `none` or `skip` are set, no information is displayed upon hovering. But, if `none` is set, click and hover events are still fired.", "dflt": "all", "editType": "none", "extras": [ "all", "none", "skip" ], "flags": [ "x", "y", "z", "text", "name" ], "role": "info", "valType": "flaglist" }, "hoverinfosrc": { "description": "Sets the source reference on plot.ly for hoverinfo .", "editType": "none", "role": "info", "valType": "string" }, "hoverlabel": { "bgcolor": { "arrayOk": true, "description": "Sets the background color of the hover labels for this trace", "editType": "none", "role": "style", "valType": "color" }, "bgcolorsrc": { "description": "Sets the source reference on plot.ly for bgcolor .", "editType": "none", "role": "info", "valType": "string" }, "bordercolor": { "arrayOk": true, "description": "Sets the border color of the hover labels for this trace.", "editType": "none", "role": "style", "valType": "color" }, "bordercolorsrc": { "description": "Sets the source reference on plot.ly for bordercolor .", "editType": "none", "role": "info", "valType": "string" }, "editType": "calc", "font": { "color": { "arrayOk": true, "editType": "none", "role": "style", "valType": "color" }, "colorsrc": { "description": "Sets the source reference on plot.ly for color .", "editType": "none", "role": "info", "valType": "string" }, "description": "Sets the font used in hover labels.", "editType": "none", "family": { "arrayOk": true, "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*.", "editType": "none", "noBlank": true, "role": "style", "strict": true, "valType": "string" }, "familysrc": { "description": "Sets the source reference on plot.ly for family .", "editType": "none", "role": "info", "valType": "string" }, "role": "object", "size": { "arrayOk": true, "editType": "none", "min": 1, "role": "style", "valType": "number" }, "sizesrc": { "description": "Sets the source reference on plot.ly for size .", "editType": "none", "role": "info", "valType": "string" } }, "namelength": { "arrayOk": true, "description": "Sets the length (in number of characters) of the trace name in the hover labels for this trace. -1 shows the whole name regardless of length. 0-3 shows the first 0-3 characters, and an integer >3 will show the whole name if it is less than that many characters, but if it is longer, will truncate to `namelength - 3` characters and add an ellipsis.", "editType": "none", "min": -1, "role": "style", "valType": "integer" }, "namelengthsrc": { "description": "Sets the source reference on plot.ly for namelength .", "editType": "none", "role": "info", "valType": "string" }, "role": "object" }, "ids": { "description": "Assigns id labels to each datum. These ids for object constancy of data points during animation.", "editType": "calc", "role": "data", "valType": "data_array" }, "idssrc": { "description": "Sets the source reference on plot.ly for ids .", "editType": "none", "role": "info", "valType": "string" }, "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": "", "editType": "style", "role": "info", "valType": "string" }, "name": { "description": "Sets the trace name. The trace name appear as the legend item and on hover.", "editType": "style", "role": "info", "valType": "string" }, "opacity": { "description": "Sets the opacity of the trace.", "dflt": 1, "editType": "style", "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, "editType": "style", "role": "info", "valType": "boolean" }, "stream": { "editType": "calc", "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.", "dflt": 500, "editType": "calc", "max": 10000, "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.", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" } }, "type": "table", "uid": { "dflt": "", "editType": "calc", "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, "editType": "calc", "role": "info", "valType": "enumerated", "values": [ true, false, "legendonly" ] } }, "meta": { "description": "Table view for detailed data viewing. The data are arranged in a grid of rows and columns. Most styling can be specified for columns, rows or individual cells. Table is using a column-major order, ie. the grid is represented as a vector of column vectors." } } }, "transforms": { "aggregate": { "attributes": { "aggregations": { "items": { "aggregation": { "editType": "calc", "enabled": { "description": "Determines whether this aggregation function is enabled or disabled.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "func": { "description": "Sets the aggregation function. All values from the linked `target`, corresponding to the same value in the `groups` array, are collected and reduced by this function. *count* is simply the number of values in the `groups` array, so does not even require the linked array to exist. *first* (*last*) is just the first (last) linked value. Invalid values are ignored, so for example in *avg* they do not contribute to either the numerator or the denominator. Any data type (numeric, date, category) may be aggregated with any function, even though in certain cases it is unlikely to make sense, for example a sum of dates or average of categories. *median* will return the average of the two central values if there is an even count. *mode* will return the first value to reach the maximum count, in case of a tie.", "dflt": "first", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "count", "sum", "avg", "median", "mode", "rms", "stddev", "min", "max", "first", "last" ] }, "funcmode": { "description": "*stddev* supports two formula variants: *sample* (normalize by N-1) and *population* (normalize by N).", "dflt": "sample", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "sample", "population" ] }, "role": "object", "target": { "description": "A reference to the data array in the parent trace to aggregate. To aggregate by nested variables, use *.* to access them. For example, set `groups` to *marker.color* to aggregate over the marker color array. The referenced array must already exist, unless `func` is *count*, and each array may only be referenced once.", "editType": "calc", "role": "info", "valType": "string" } } }, "role": "object" }, "editType": "calc", "enabled": { "description": "Determines whether this aggregate transform is enabled or disabled.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "groups": { "arrayOk": true, "description": "Sets the grouping target to which the aggregation is applied. Data points with matching group values will be coalesced into one point, using the supplied aggregation functions to reduce data in other data arrays. If a string, `groups` is assumed to be a reference to a data array in the parent trace object. To aggregate by nested variables, use *.* to access them. For example, set `groups` to *marker.color* to aggregate about the marker color array. If an array, `groups` is itself the data array by which we aggregate.", "dflt": "x", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" }, "groupssrc": { "description": "Sets the source reference on plot.ly for groups .", "editType": "none", "role": "info", "valType": "string" } } }, "candlestick": { "attributes": {} }, "filter": { "attributes": { "editType": "calc", "enabled": { "description": "Determines whether this filter transform is enabled or disabled.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "operation": { "description": "Sets the filter operation. *=* keeps items equal to `value` *!=* keeps items not equal to `value` *<* keeps items less than `value` *<=* keeps items less than or equal to `value` *>* keeps items greater than `value` *>=* keeps items greater than or equal to `value` *[]* keeps items inside `value[0]` to value[1]` including both bounds` *()* keeps items inside `value[0]` to value[1]` excluding both bounds` *[)* keeps items inside `value[0]` to value[1]` including `value[0]` but excluding `value[1] *(]* keeps items inside `value[0]` to value[1]` excluding `value[0]` but including `value[1] *][* keeps items outside `value[0]` to value[1]` and equal to both bounds` *)(* keeps items outside `value[0]` to value[1]` *](* keeps items outside `value[0]` to value[1]` and equal to `value[0]` *)[* keeps items outside `value[0]` to value[1]` and equal to `value[1]` *{}* keeps items present in a set of values *}{* keeps items not present in a set of values", "dflt": "=", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "=", "!=", "<", ">=", ">", "<=", "[]", "()", "[)", "(]", "][", ")(", "](", ")[", "{}", "}{" ] }, "preservegaps": { "description": "Determines whether or not gaps in data arrays produced by the filter operation are preserved. Setting this to *true* might be useful when plotting a line chart with `connectgaps` set to *false*.", "dflt": false, "editType": "calc", "role": "info", "valType": "boolean" }, "target": { "arrayOk": true, "description": "Sets the filter target by which the filter is applied. If a string, `target` is assumed to be a reference to a data array in the parent trace object. To filter about nested variables, use *.* to access them. For example, set `target` to *marker.color* to filter about the marker color array. If an array, `target` is then the data array by which the filter is applied.", "dflt": "x", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" }, "targetcalendar": { "description": "Sets the calendar system to use for `target`, if it is an array of dates. If `target` is a string (eg *x*) we use the corresponding trace attribute (eg `xcalendar`) if it exists, even if `targetcalendar` is provided.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] }, "targetsrc": { "description": "Sets the source reference on plot.ly for target .", "editType": "none", "role": "info", "valType": "string" }, "value": { "description": "Sets the value or values by which to filter. Values are expected to be in the same type as the data linked to `target`. When `operation` is set to one of the comparison values (=,!=,<,>=,>,<=) `value` is expected to be a number or a string. When `operation` is set to one of the interval values ([],(),[),(],][,)(,](,)[) `value` is expected to be 2-item array where the first item is the lower bound and the second item is the upper bound. When `operation`, is set to one of the set values ({},}{) `value` is expected to be an array with as many items as the desired set elements.", "dflt": 0, "editType": "calc", "role": "info", "valType": "any" }, "valuecalendar": { "description": "Sets the calendar system to use for `value`, if it is a date.", "dflt": "gregorian", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "gregorian", "chinese", "coptic", "discworld", "ethiopian", "hebrew", "islamic", "julian", "mayan", "nanakshahi", "nepali", "persian", "jalali", "taiwan", "thai", "ummalqura" ] } } }, "groupby": { "attributes": { "editType": "calc", "enabled": { "description": "Determines whether this group-by transform is enabled or disabled.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "groups": { "description": "Sets the groups in which the trace data will be split. For example, with `x` set to *[1, 2, 3, 4]* and `groups` set to *['a', 'b', 'a', 'b']*, the groupby transform with split in one trace with `x` [1, 3] and one trace with `x` [2, 4].", "dflt": [], "editType": "calc", "role": "data", "valType": "data_array" }, "groupssrc": { "description": "Sets the source reference on plot.ly for groups .", "editType": "none", "role": "info", "valType": "string" }, "nameformat": { "description": "Pattern by which grouped traces are named. If only one trace is present, defaults to the group name (`\"%{group}\"`), otherwise defaults to the group name with trace name (`\"%{group} (%{trace})\"`). Available escape sequences are `%{group}`, which inserts the group name, and `%{trace}`, which inserts the trace name. If grouping GDP data by country when more than one trace is present, for example, the default \"%{group} (%{trace})\" would return \"Monaco (GDP per capita)\".", "editType": "calc", "role": "info", "valType": "string" }, "styles": { "items": { "style": { "editType": "calc", "role": "object", "target": { "description": "The group value which receives these styles.", "editType": "calc", "role": "info", "valType": "string" }, "value": { "description": "Sets each group styles. For example, with `groups` set to *['a', 'b', 'a', 'b']* and `styles` set to *[{target: 'a', value: { marker: { color: 'red' } }}] marker points in group *'a'* will be drawn in red.", "dflt": {}, "editType": "calc", "role": "info", "valType": "any" } } }, "role": "object" } } }, "ohlc": { "attributes": {} }, "sort": { "attributes": { "editType": "calc", "enabled": { "description": "Determines whether this sort transform is enabled or disabled.", "dflt": true, "editType": "calc", "role": "info", "valType": "boolean" }, "order": { "description": "Sets the sort transform order.", "dflt": "ascending", "editType": "calc", "role": "info", "valType": "enumerated", "values": [ "ascending", "descending" ] }, "target": { "arrayOk": true, "description": "Sets the target by which the sort transform is applied. If a string, *target* is assumed to be a reference to a data array in the parent trace object. To sort about nested variables, use *.* to access them. For example, set `target` to *marker.size* to sort about the marker size array. If an array, *target* is then the data array by which the sort transform is applied.", "dflt": "x", "editType": "calc", "noBlank": true, "role": "info", "strict": true, "valType": "string" }, "targetsrc": { "description": "Sets the source reference on plot.ly for target .", "editType": "none", "role": "info", "valType": "string" } } } } }plotly-2.2.3+dfsg.orig/plotly/package_data/graphWidget.js0000644000175000017500000001532613104403274022766 0ustar noahfxnoahfxwindow.genUID = function() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); return v.toString(16); }); }; var IPYTHON_VERSION = '3'; require(["widgets/js/widget", "widgets/js/manager"], function (widget, manager) { if (!('DOMWidgetView' in widget)) { // we're in IPython2, things moved a bit from 2 --> 3. // construct the expected IPython3 widget API IPYTHON_VERSION = '2'; manager = {WidgetManager: widget}; widget = {DOMWidgetView: IPython.DOMWidgetView}; } var GraphView = widget.DOMWidgetView.extend({ render: function(){ var that = this; var graphId = window.genUID(); var loadingId = 'loading-'+graphId; var _graph_url = that.model.get('_graph_url'); // variable plotlyDomain in the case of enterprise var url_parts = _graph_url.split('/'); var plotlyDomain = url_parts[0] + '//' + url_parts[2]; if(!('plotlyDomains' in window)){ window.plotlyDomains = {}; } window.plotlyDomains[graphId] = plotlyDomain; // Place IFrame in output cell div `$el` that.$el.css('width', '100%'); that.$graph = $([''].join(' ')); that.$graph.appendTo(that.$el); that.$loading = $('
Initializing...
') .appendTo(that.$el); // for some reason the 'width' is being changed in IPython 3.0.0 // for the containing `div` element. There's a flicker here, but // I was unable to fix it otherwise. setTimeout(function () { if (IPYTHON_VERSION === '3') { $('#' + graphId)[0].parentElement.style.width = '100%'; } }, 500); // initialize communication with the iframe if(!('pingers' in window)){ window.pingers = {}; } window.pingers[graphId] = setInterval(function() { that.graphContentWindow = $('#'+graphId)[0].contentWindow; that.graphContentWindow.postMessage({task: 'ping'}, plotlyDomain); }, 200); // Assign a message listener to the 'message' events // from iframe's postMessage protocol. // Filter the messages by iframe src so that the right message // gets passed to the right widget if(!('messageListeners' in window)){ window.messageListeners = {}; } window.messageListeners[graphId] = function(e) { if(_graph_url.indexOf(e.origin)>-1) { var frame = document.getElementById(graphId); if(frame === null){ // frame doesn't exist in the dom anymore, clean up it's old event listener window.removeEventListener('message', window.messageListeners[graphId]); clearInterval(window.pingers[graphId]); } else if(frame.contentWindow === e.source) { // TODO: Stop event propagation, so each frame doesn't listen and filter var frameContentWindow = $('#'+graphId)[0].contentWindow; var message = e.data; if('pong' in message && message.pong) { $('#loading-'+graphId).hide(); clearInterval(window.pingers[graphId]); that.send({event: 'pong', graphId: graphId}); } else if (message.type==='hover' || message.type==='zoom' || message.type==='click' || message.type==='unhover') { // click and hover events contain all of the data in the traces, // which can be a very large object and may take a ton of time // to pass to the python backend. Strip out the data, and require // the user to call get_figure if they need trace information if(message.type !== 'zoom') { for(var i in message.points) { delete message.points[i].data; delete message.points[i].fullData; } } that.send({event: message.type, message: message, graphId: graphId}); } else if (message.task === 'getAttributes') { that.send({event: 'getAttributes', response: message.response}); } } } }; window.removeEventListener('message', window.messageListeners[graphId]); window.addEventListener('message', window.messageListeners[graphId]); }, update: function() { // Listen for messages from the graph widget in python var jmessage = this.model.get('_message'); var message = JSON.parse(jmessage); // check for duplicate messages if(!('messageIds' in window)){ window.messageIds = {}; } if(!(message.uid in window.messageIds)){ // message hasn't been received yet, do stuff window.messageIds[message.uid] = true; if (message.fadeTo) { this.fadeTo(message); } else { var plot = $('#' + message.graphId)[0].contentWindow; plot.postMessage(message, window.plotlyDomains[message.graphId]); } } return GraphView.__super__.update.apply(this); }, /** * Wrapper for jquery's `fadeTo` function. * * @param message Contains the id we need to find the element. */ fadeTo: function (message) { var plot = $('#' + message.graphId); plot.fadeTo(message.duration, message.opacity); } }); // Register the GraphView with the widget manager. manager.WidgetManager.register_widget_view('GraphView', GraphView); }); //@ sourceURL=graphWidget.js plotly-2.2.3+dfsg.orig/plotly/widgets/0000755000175000017500000000000013211605515017237 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly/widgets/graph_widget.py0000644000175000017500000007242113104403274022262 0ustar noahfxnoahfx""" Module to allow Plotly graphs to interact with IPython widgets. """ import uuid from collections import deque from pkg_resources import resource_string from requests.compat import json as _json # TODO: protected imports? from IPython.html import widgets from IPython.utils.traitlets import Unicode from IPython.display import Javascript, display import plotly.plotly.plotly as py from plotly import utils, tools from plotly.graph_objs import Figure # Load JS widget code # No officially recommended way to do this in any other way # http://mail.scipy.org/pipermail/ipython-dev/2014-April/013835.html js_widget_code = resource_string('plotly', 'package_data/graphWidget.js').decode('utf-8') display(Javascript(js_widget_code)) __all__ = None class GraphWidget(widgets.DOMWidget): """An interactive Plotly graph widget for use in IPython Notebooks. """ _view_name = Unicode('GraphView', sync=True) _message = Unicode(sync=True) _graph_url = Unicode(sync=True) _new_url = Unicode(sync=True) _filename = '' _flags = { 'save_pending': False } # TODO: URL for offline enterprise def __init__(self, graph_url='https://plot.ly/~playground/7', **kwargs): """Initialize a plotly graph widget Args: graph_url: The url of a Plotly graph Example: ``` GraphWidget('https://plot.ly/~chris/3375') ``` """ super(GraphWidget, self).__init__(**kwargs) # TODO: Validate graph_url self._graph_url = graph_url self._listener_set = set() self._event_handlers = { 'click': widgets.CallbackDispatcher(), 'hover': widgets.CallbackDispatcher(), 'zoom': widgets.CallbackDispatcher() } self._graphId = '' self.on_msg(self._handle_msg) # messages to the iframe client need to wait for the # iframe to communicate that it is ready # unfortunately, this two-way blocking communication # isn't possible # (https://github.com/ipython/ipython/wiki/IPEP-21:-Widget-Messages#caveats) # so we'll just cue up messages until they're ready to be sent self._clientMessages = deque() @property def url(self): return self._new_url or '' def _handle_msg(self, message): """Handle a msg from the front-end. Args: content (dict): Content of the msg. """ content = message['content']['data']['content'] if content.get('event', '') == 'pong': self._graphId = content['graphId'] # ready to recieve - pop out all of the items in the deque while self._clientMessages: _message = self._clientMessages.popleft() _message['graphId'] = self._graphId _message = _json.dumps(_message) self._message = _message if content.get('event', '') in ['click', 'hover', 'zoom']: # De-nest the message if content['event'] == 'click' or content['event'] == 'hover': message = content['message']['points'] elif content['event'] == 'zoom': message = content['message']['ranges'] self._event_handlers[content['event']](self, message) if content.get('event', '') == 'getAttributes': self._attributes = content.get('response', {}) # there might be a save pending, use the plotly module to save if self._flags['save_pending']: self._flags['save_pending'] = False url = py.plot(self._attributes, auto_open=False, filename=self._filename, validate=False) self._new_url = url self._fade_to('slow', 1) def _handle_registration(self, event_type, callback, remove): self._event_handlers[event_type].register_callback(callback, remove=remove) event_callbacks = self._event_handlers[event_type].callbacks if (len(event_callbacks) and event_type not in self._listener_set): self._listener_set.add(event_type) message = {'task': 'listen', 'events': list(self._listener_set)} self._handle_outgoing_message(message) def _handle_outgoing_message(self, message): if self._graphId == '': self._clientMessages.append(message) else: message['graphId'] = self._graphId message['uid'] = str(uuid.uuid4()) self._message = _json.dumps(message, cls=utils.PlotlyJSONEncoder) def on_click(self, callback, remove=False): """ Assign a callback to click events propagated by clicking on point(s) in the Plotly graph. Args: callback (function): Callback function this is called on click events with the signature: callback(widget, hover_obj) -> None Args: widget (GraphWidget): The current instance of the graph widget that this callback is assigned to. click_obj (dict): a nested dict that describes which point(s) were clicked on. click_obj example: [ { 'curveNumber': 1, 'pointNumber': 2, 'x': 4, 'y': 14 } ] remove (bool, optional): If False, attach the callback. If True, remove the callback. Defaults to False. Returns: None Example: ``` from IPython.display import display def message_handler(widget, msg): display(widget._graph_url) display(msg) g = GraphWidget('https://plot.ly/~chris/3375') display(g) g.on_click(message_handler) ``` """ self._handle_registration('click', callback, remove) def on_hover(self, callback, remove=False): """ Assign a callback to hover events propagated by hovering over points in the Plotly graph. Args: callback (function): Callback function this is called on hover events with the signature: callback(widget, hover_obj) -> None Args: widget (GraphWidget): The current instance of the graph widget that this callback is assigned to. hover_obj (dict): a nested dict that describes which point(s) was hovered over. hover_obj example: [ { 'curveNumber': 1, 'pointNumber': 2, 'x': 4, 'y': 14 } ] remove (bool, optional): If False, attach the callback. If True, remove the callback. Defaults to False. Returns: None Example: ``` from IPython.display import display def message_handler(widget, hover_msg): display(widget._graph_url) display(hover_msg) g = GraphWidget('https://plot.ly/~chris/3375') display(g) g.on_hover(message_handler) ``` """ self._handle_registration('hover', callback, remove) def on_zoom(self, callback, remove=False): """ Assign a callback to zoom events propagated by zooming in regions in the Plotly graph. Args: callback (function): Callback function this is called on zoom events with the signature: callback(widget, ranges) -> None Args: widget (GraphWidget): The current instance of the graph widget that this callback is assigned to. ranges (dict): A description of the region that was zoomed into. ranges example: { 'x': [1.8399058038561549, 2.16443359662], 'y': [4.640902872777017, 7.855677154582] } remove (bool, optional): If False, attach the callback. If True, remove the callback. Defaults to False. Returns: None Example: ``` from IPython.display import display def message_handler(widget, ranges): display(widget._graph_url) display(ranges) g = GraphWidget('https://plot.ly/~chris/3375') display(g) g.on_zoom(message_handler) ``` """ self._handle_registration('zoom', callback, remove) def plot(self, figure_or_data, validate=True): """Plot figure_or_data in the Plotly graph widget. Args: figure_or_data (dict, list, or plotly.graph_obj object): The standard Plotly graph object that describes Plotly graphs as used in `plotly.plotly.plot`. See examples of the figure_or_data in https://plot.ly/python/ Returns: None Example 1 - Graph a scatter plot: ``` from plotly.graph_objs import Scatter g = GraphWidget() g.plot([Scatter(x=[1, 2, 3], y=[10, 15, 13])]) ``` Example 2 - Graph a scatter plot with a title: ``` from plotly.graph_objs import Scatter, Figure, Data fig = Figure( data = Data([ Scatter(x=[1, 2, 3], y=[20, 15, 13]) ]), layout = Layout(title='Experimental Data') ) g = GraphWidget() g.plot(fig) ``` Example 3 - Clear a graph widget ``` from plotly.graph_objs import Scatter, Figure g = GraphWidget() g.plot([Scatter(x=[1, 2, 3], y=[10, 15, 13])]) # Now clear it g.plot({}) # alternatively, g.plot(Figure()) ``` """ if figure_or_data == {} or figure_or_data == Figure(): validate = False figure = tools.return_figure_from_figure_or_data(figure_or_data, validate) message = { 'task': 'newPlot', 'data': figure.get('data', []), 'layout': figure.get('layout', {}), 'graphId': self._graphId } self._handle_outgoing_message(message) def restyle(self, update, indices=None): """Update the style of existing traces in the Plotly graph. Args: update (dict): dict where keys are the graph attribute strings and values are the value of the graph attribute. To update graph objects that are nested, like a marker's color, combine the keys with a period, e.g. `marker.color`. To replace an entire nested object, like `marker`, set the value to the object. See Example 2 below. To update an attribute of multiple traces, set the value to an list of values. If the list is shorter than the number of traces, the values will wrap around. Note: this means that for values that are naturally an array, like `x` or `colorscale`, you need to wrap the value in an extra array, i.e. {'colorscale': [[[0, 'red'], [1, 'green']]]} You can also supply values to different traces with the indices argument. See all of the graph attributes in our reference documentation here: https://plot.ly/python/reference or by calling `help` on graph objects in `plotly.graph_objs`. indices (list, optional): Specify which traces to apply the update dict to. Negative indices are supported. If indices are not given, the update will apply to *all* traces. Examples: Initialization - Start each example below with this setup: ``` from plotly.widgets import GraphWidget from IPython.display import display graph = GraphWidget() display(graph) ``` Example 1 - Set `marker.color` to red in every trace in the graph ``` graph.restyle({'marker.color': 'red'}) ``` Example 2 - Replace `marker` with {'color': 'red'} ``` graph.restyle({'marker': {'color': red'}}) ``` Example 3 - Set `marker.color` to red in the first trace of the graph ``` graph.restyle({'marker.color': 'red'}, indices=[0]) ``` Example 4 - Set `marker.color` of all of the traces to alternating sequences of red and green ``` graph.restyle({'marker.color': ['red', 'green']}) ``` Example 5 - Set just `marker.color` of the first two traces to red and green ``` graph.restyle({'marker.color': ['red', 'green']}, indices=[0, 1]) ``` Example 6 - Set multiple attributes of all of the traces ``` graph.restyle({ 'marker.color': 'red', 'line.color': 'green' }) ``` Example 7 - Update the data of the first trace ``` graph.restyle({ 'x': [[1, 2, 3]], 'y': [[10, 20, 30]], }, indices=[0]) ``` Example 8 - Update the data of the first two traces ``` graph.restyle({ 'x': [[1, 2, 3], [1, 2, 4]], 'y': [[10, 20, 30], [5, 8, 14]], }, indices=[0, 1]) ``` """ # TODO: Add flat traces to graph_objs message = { 'task': 'restyle', 'update': update, 'graphId': self._graphId } if indices: message['indices'] = indices self._handle_outgoing_message(message) def relayout(self, layout): """Update the layout of the Plotly graph. Args: layout (dict): dict where keys are the graph attribute strings and values are the value of the graph attribute. To update graph objects that are nested, like the title of an axis, combine the keys with a period e.g. `xaxis.title`. To set a value of an element in an array, like an axis's range, use brackets, e.g. 'xaxis.range[0]'. To replace an entire nested object, just specify the value to the sub-object. See example 4 below. See all of the layout attributes in our reference documentation https://plot.ly/python/reference/#Layout Or by calling `help` on `plotly.graph_objs.Layout` Examples - Start each example below with this setup: Initialization: ``` from plotly.widgets import GraphWidget from IPython.display import display graph = GraphWidget('https://plot.ly/~chris/3979') display(graph) ``` Example 1 - Update the title ``` graph.relayout({'title': 'Experimental results'}) ``` Example 2 - Update the xaxis range ``` graph.relayout({'xaxis.range': [-1, 6]}) ``` Example 3 - Update the first element of the xaxis range ``` graph.relayout({'xaxis.range[0]': -3}) ``` Example 4 - Replace the entire xaxis object ``` graph.relayout({'xaxis': {'title': 'Experimental results'}}) ``` """ # TODO: Add flat layout to graph_objs message = { 'task': 'relayout', 'update': layout, 'graphId': self._graphId } self._handle_outgoing_message(message) def hover(self, *hover_objs): """Show hover labels over the points specified in hover_obj. Hover labels are the labels that normally appear when the mouse hovers over points in the plotly graph. Args: hover_objs (tuple of dicts): Specifies which points to place hover labels over. The location of the hover labels is described by a dict with keys and'xval' and/or 'yval' or 'curveNumber' and 'pointNumber' and optional keys 'hovermode' and 'subplot' 'xval' and 'yval' specify the (x, y) coordinates to place the label. 'xval' and 'yval need to be close to a point drawn in a graph. 'curveNumber' and 'pointNumber' specify the trace number and the index theof the point in that trace respectively. 'subplot' describes which axes to the coordinates refer to. By default, it is equal to 'xy'. For example, to specify the second x-axis and the third y-axis, set 'subplot' to 'x2y3' 'hovermode' is either 'closest', 'x', or 'y'. When set to 'x', all data sharing the same 'x' coordinate will be shown on screen with corresponding trace labels. When set to 'y' all data sharing the same 'y' coordinates will be shown on the screen with corresponding trace labels. When set to 'closest', information about the data point closest to where the viewer is hovering will appear. Note: If 'hovermode' is 'x', only 'xval' needs to be set. If 'hovermode' is 'y', only 'yval' needs to be set. If 'hovermode' is 'closest', 'xval' and 'yval' both need to be set. Note: 'hovermode' can be toggled by the user in the graph toolbar. Note: It is not currently possible to apply multiple hover labels to points on different axes. Note: `hover` can only be called with multiple dicts if 'curveNumber' and 'pointNumber' are the keys of the dicts Examples: Initialization - Start each example below with this setup: ``` from plotly.widgets import GraphWidget from IPython.display import display graph = GraphWidget('https://plot.ly/~chris/3979') display(graph) ``` Example 1 - Apply a label to the (x, y) point (3, 2) ``` graph.hover({'xval': 3, 'yval': 2, 'hovermode': 'closest'}) ``` Example 2 -Apply a labels to all the points with the x coordinate 3 ``` graph.hover({'xval': 3, 'hovermode': 'x'}) ``` Example 3 - Apply a label to the first point of the first trace and the second point of the second trace. ``` graph.hover({'curveNumber': 0, 'pointNumber': 0}, {'curveNumber': 1, 'pointNumber': 1}) ``` """ # TODO: Add to graph objects if len(hover_objs) == 1: hover_objs = hover_objs[0] message = { 'task': 'hover', 'selection': hover_objs, 'graphId': self._graphId } self._handle_outgoing_message(message) def add_traces(self, traces, new_indices=None): """ Add new data traces to a graph. If `new_indices` isn't specified, they are simply appended. Args: traces (dict or list of dicts, or class of plotly.graph_objs):trace new_indices (list[int]|None), optional: The final indices the added traces should occupy in the graph. Examples: Initialization - Start each example below with this setup: ``` from plotly.widgets import GraphWidget from plotly.graph_objs import Scatter from IPython.display import display graph = GraphWidget('https://plot.ly/~chris/3979') display(graph) ``` Example 1 - Add a scatter/line trace to the graph ``` graph.add_traces(Scatter(x = [1, 2, 3], y = [5, 4, 5])) ``` Example 2 - Add a scatter trace and set it to to be the second trace. This will appear as the second item in the legend. ``` graph.add_traces(Scatter(x = [1, 2, 3], y = [5, 6, 5]), new_indices=[1]) ``` Example 3 - Add multiple traces to the graph ``` graph.add_traces([ Scatter(x = [1, 2, 3], y = [5, 6, 5]), Scatter(x = [1, 2.5, 3], y = [5, 8, 5]) ]) ``` """ # TODO: Validate traces with graph_objs message = { 'task': 'addTraces', 'traces': traces, 'graphId': self._graphId } if new_indices is not None: message['newIndices'] = new_indices self._handle_outgoing_message(message) def delete_traces(self, indices): """Delete data traces from a graph. Args: indices (list[int]): The indices of the traces to be removed Example - Delete the 2nd trace: ``` from plotly.widgets import GraphWidget from IPython.display import display graph = GraphWidget('https://plot.ly/~chris/3979') display(graph) graph.delete_traces([1]) ``` """ message = { 'task': 'deleteTraces', 'indices': indices, 'graphId': self._graphId } self._handle_outgoing_message(message) def reorder_traces(self, current_indices, new_indices=None): """Reorder the traces in a graph. The order of the traces determines the order of the legend entries and the layering of the objects drawn in the graph, i.e. the first trace is drawn first and the second trace is drawn on top of the first trace. Args: current_indices (list[int]): The index of the traces to reorder. new_indices (list[int], optional): The index of the traces specified by `current_indices` after ordering. If None, then move the traces to the end. Examples: Example 1 - Move the first trace to the second to last position, the second trace to the last position ``` graph.move_traces([0, 1]) ``` Example 2 - Move the first trace to the second position, the second trace to the first position. ``` graph.move_traces([0], [1]) ``` """ message = { 'task': 'moveTraces', 'currentIndices': current_indices, 'graphId': self._graphId } if new_indices is not None: message['newIndices'] = new_indices self._handle_outgoing_message(message) def save(self, ignore_defaults=False, filename=''): """ Save a copy of the current state of the widget in plotly. :param (bool) ignore_defaults: Auto-fill in unspecified figure keys? :param (str) filename: Name of the file on plotly. """ self._flags['save_pending'] = True self._filename = filename message = {'task': 'getAttributes', 'ignoreDefaults': ignore_defaults} self._handle_outgoing_message(message) self._fade_to('slow', 0.1) def extend_traces(self, update, indices=(0,), max_points=None): """ Append data points to existing traces in the Plotly graph. Args: update (dict): dict where keys are the graph attribute strings and values are arrays of arrays with values to extend. Each array in the array will extend a trace. Valid keys include: 'x', 'y', 'text, 'marker.color', 'marker.size', 'marker.symbol', 'marker.line.color', 'marker.line.width' indices (list, int): Specify which traces to apply the `update` dict to. If indices are not given, the update will apply to the traces in order. max_points (int or dict, optional): If specified, then only show the `max_points` most recent points in the graph. This is useful to prevent traces from becoming too large (and slow) or for creating "windowed" graphs in monitoring applications. To set max_points to different values for each trace or attribute, set max_points to a dict mapping keys to max_points values. See the examples below. Examples: Initialization - Start each example below with this setup: ``` from plotly.widgets import GraphWidget from IPython.display import display graph = GraphWidget() graph.plot([ {'x': [], 'y': []}, {'x': [], 'y': []} ]) display(graph) ``` Example 1 - Extend the first trace with x and y data ``` graph.extend_traces({'x': [[1, 2, 3]], 'y': [[10, 20, 30]]}, indices=[0]) ``` Example 2 - Extend the second trace with x and y data ``` graph.extend_traces({'x': [[1, 2, 3]], 'y': [[10, 20, 30]]}, indices=[1]) ``` Example 3 - Extend the first two traces with x and y data ``` graph.extend_traces({ 'x': [[1, 2, 3], [2, 3, 4]], 'y': [[10, 20, 30], [3, 4, 3]] }, indices=[0, 1]) ``` Example 4 - Extend the first trace with x and y data and limit the length of data in that trace to 50 points. ``` graph.extend_traces({ 'x': [range(100)], 'y': [range(100)] }, indices=[0, 1], max_points=50) ``` Example 5 - Extend the first and second trace with x and y data and limit the length of data in the first trace to 25 points and the second trace to 50 points. ``` new_points = range(100) graph.extend_traces({ 'x': [new_points, new_points], 'y': [new_points, new_points] }, indices=[0, 1], max_points={ 'x': [25, 50], 'y': [25, 50] } ) ``` Example 6 - Update other attributes, like marker colors and sizes and text ``` # Initialize a plot with some empty attributes graph.plot([{ 'x': [], 'y': [], 'text': [], 'marker': { 'size': [], 'color': [] } }]) # Append some data into those attributes graph.extend_traces({ 'x': [[1, 2, 3]], 'y': [[10, 20, 30]], 'text': [['A', 'B', 'C']], 'marker.size': [[10, 15, 20]], 'marker.color': [['blue', 'red', 'orange']] }, indices=[0]) ``` Example 7 - Live-update a graph over a few seconds ``` import time graph.plot([{'x': [], 'y': []}]) for i in range(10): graph.extend_traces({ 'x': [[i]], 'y': [[i]] }, indices=[0]) time.sleep(0.5) ``` """ message = { 'task': 'extendTraces', 'update': update, 'graphId': self._graphId, 'indices': indices } if max_points is not None: message['maxPoints'] = max_points self._handle_outgoing_message(message) def _fade_to(self, duration, opacity): """ Change the opacity to give a visual signal to users. """ message = {'fadeTo': True, 'duration': duration, 'opacity': opacity} self._handle_outgoing_message(message) plotly-2.2.3+dfsg.orig/plotly/widgets/__init__.py0000644000175000017500000000013413104403274021345 0ustar noahfxnoahfxfrom __future__ import absolute_import from plotly.widgets.graph_widget import GraphWidget plotly-2.2.3+dfsg.orig/setup.cfg0000644000175000017500000000012013211605515016060 0ustar noahfxnoahfx[metadata] description-file = README.rst [egg_info] tag_build = tag_date = 0 plotly-2.2.3+dfsg.orig/README.rst0000644000175000017500000000634013104403274015737 0ustar noahfxnoahfx======= plotly: ======= -------------------------- It's all about the graphs. -------------------------- The Nutshell ~~~~~~~~~~~~ Use this package to make collaborative, interactive, publication-quality graphs from Python. Here's how you import:: import plotly.plotly as py # for sending things to plotly import plotly.tools as tls # for mpl, config, etc. from plotly.graph_objs import * # __all__ is safely defined Here's how you sign in:: py.sign_in('PythonAPI', 'ubpiol2cve') # get your own at https://plot.ly/ Here's how you plot data or a figure:: py.plot(data_or_figure_here) Here's what you get: * an account on plotly * a unique url for your data/figures * an interactive web-application to edit your figure or make new figures * a platform on which to share your data/figures with the world You can also convert supported matplotlib figures:: py.plot_mpl(mplfig) Stop fighting with your figures; start designing them. Check out our Quickstart_ to get going. About ~~~~~ Plotly_ is an online collaborative data analysis and graphing tool. The Python API allows you to access all of Plotly's functionality from Python. Plotly figures are shared, tracked, and edited all online and the data is always accessible from the graph. That's it. Find out more, sign up, and start sharing by visiting us at https://plot.ly. Install via pip ~~~~~~~~~~~~~~~ Assuming you have already installed pip, you can simply enter the following in a terminal program:: $ pip install plotly Contributing! ~~~~~~~~~~~~~ If you want to contribute to making Plotly's Python API experience better, head to our `GitHub repo`_. Instructions for installing from here, updating the included submodules, and contributing are detailed there! Plotly, matplotlib, and mpld3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The matplotlylib sub-package allows you to convert matplotlib figures to plotly figures, with a one-liner:: py.plot_mpl(fig) Checkout the `Plotly and mpld3`_ IPython notebook for more information. Introduction to working with out API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Checkout the `Plotly and Python`_ IPython notebook to get a more in depth exposition of our Python API. Plotly's *guide book* ~~~~~~~~~~~~~~~~~~~~~ Still here? Don't worry, we've got more documentation for you. Checkout a *highly* complete `set of notebooks`_ for walk-throughs on all the features we offer! Details ~~~~~~~ The plotly package depends on requests, which will be installed by pip for you. To use the matplotlylib subpackage, you'll also need to have matplotlib 1.3.1 properly installed on your machine. The matpotlylib package is based on the mplexporter framework for crawling and exporting matplotlib images. Created by: Plotly_, `@plotlygraphs`_, `feedback@plot.ly`_ License: MIT .. _Plotly: https://plot.ly .. _Quickstart: https://plot.ly/python .. _GitHub repo: https://github.com/plotly/python-api .. _Plotly and mpld3: https://plot.ly/python/matplotlib-to-plotly-tutorial/ .. _Plotly and Python: https://plot.ly/python/overview/ .. _set of notebooks: https://plot.ly/python/user-guide/ .. _plotly profile: https://plot.ly/~mpld3/ .. _@plotlygraphs: https://twitter.com/plotlygraphs .. _feedback@plot.ly: feedback@plot.ly plotly-2.2.3+dfsg.orig/PKG-INFO0000644000175000017500000001146513211605515015352 0ustar noahfxnoahfxMetadata-Version: 1.1 Name: plotly Version: 2.2.3 Summary: Python plotting library for collaborative, interactive, publication-quality graphs. Home-page: https://plot.ly/python/ Author: Chris P Author-email: chris@plot.ly License: MIT Description-Content-Type: UNKNOWN Description: ======= plotly: ======= -------------------------- It's all about the graphs. -------------------------- The Nutshell ~~~~~~~~~~~~ Use this package to make collaborative, interactive, publication-quality graphs from Python. Here's how you import:: import plotly.plotly as py # for sending things to plotly import plotly.tools as tls # for mpl, config, etc. from plotly.graph_objs import * # __all__ is safely defined Here's how you sign in:: py.sign_in('PythonAPI', 'ubpiol2cve') # get your own at https://plot.ly/ Here's how you plot data or a figure:: py.plot(data_or_figure_here) Here's what you get: * an account on plotly * a unique url for your data/figures * an interactive web-application to edit your figure or make new figures * a platform on which to share your data/figures with the world You can also convert supported matplotlib figures:: py.plot_mpl(mplfig) Stop fighting with your figures; start designing them. Check out our Quickstart_ to get going. About ~~~~~ Plotly_ is an online collaborative data analysis and graphing tool. The Python API allows you to access all of Plotly's functionality from Python. Plotly figures are shared, tracked, and edited all online and the data is always accessible from the graph. That's it. Find out more, sign up, and start sharing by visiting us at https://plot.ly. Install via pip ~~~~~~~~~~~~~~~ Assuming you have already installed pip, you can simply enter the following in a terminal program:: $ pip install plotly Contributing! ~~~~~~~~~~~~~ If you want to contribute to making Plotly's Python API experience better, head to our `GitHub repo`_. Instructions for installing from here, updating the included submodules, and contributing are detailed there! Plotly, matplotlib, and mpld3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The matplotlylib sub-package allows you to convert matplotlib figures to plotly figures, with a one-liner:: py.plot_mpl(fig) Checkout the `Plotly and mpld3`_ IPython notebook for more information. Introduction to working with out API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Checkout the `Plotly and Python`_ IPython notebook to get a more in depth exposition of our Python API. Plotly's *guide book* ~~~~~~~~~~~~~~~~~~~~~ Still here? Don't worry, we've got more documentation for you. Checkout a *highly* complete `set of notebooks`_ for walk-throughs on all the features we offer! Details ~~~~~~~ The plotly package depends on requests, which will be installed by pip for you. To use the matplotlylib subpackage, you'll also need to have matplotlib 1.3.1 properly installed on your machine. The matpotlylib package is based on the mplexporter framework for crawling and exporting matplotlib images. Created by: Plotly_, `@plotlygraphs`_, `feedback@plot.ly`_ License: MIT .. _Plotly: https://plot.ly .. _Quickstart: https://plot.ly/python .. _GitHub repo: https://github.com/plotly/python-api .. _Plotly and mpld3: https://plot.ly/python/matplotlib-to-plotly-tutorial/ .. _Plotly and Python: https://plot.ly/python/overview/ .. _set of notebooks: https://plot.ly/python/user-guide/ .. _plotly profile: https://plot.ly/~mpld3/ .. _@plotlygraphs: https://twitter.com/plotlygraphs .. _feedback@plot.ly: feedback@plot.ly Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Scientific/Engineering :: Visualization plotly-2.2.3+dfsg.orig/plotly.egg-info/0000755000175000017500000000000013211605515017263 5ustar noahfxnoahfxplotly-2.2.3+dfsg.orig/plotly.egg-info/top_level.txt0000644000175000017500000000047713211605515022025 0ustar noahfxnoahfxplotly plotly/api plotly/api/v1 plotly/api/v2 plotly/dashboard_objs plotly/figure_factory plotly/graph_objs plotly/grid_objs plotly/matplotlylib plotly/matplotlylib/mplexporter plotly/matplotlylib/mplexporter/renderers plotly/offline plotly/plotly plotly/plotly/chunked_requests plotly/presentation_objs plotly/widgets plotly-2.2.3+dfsg.orig/plotly.egg-info/dependency_links.txt0000644000175000017500000000000113211605515023331 0ustar noahfxnoahfx plotly-2.2.3+dfsg.orig/plotly.egg-info/not-zip-safe0000644000175000017500000000000113122513732021511 0ustar noahfxnoahfx plotly-2.2.3+dfsg.orig/plotly.egg-info/SOURCES.txt0000644000175000017500000000524613211605515021156 0ustar noahfxnoahfxREADME.rst setup.cfg setup.py plotly/__init__.py plotly/colors.py plotly/config.py plotly/exceptions.py plotly/files.py plotly/graph_reference.py plotly/optional_imports.py plotly/session.py plotly/tools.py plotly/utils.py plotly/version.py plotly.egg-info/PKG-INFO plotly.egg-info/SOURCES.txt plotly.egg-info/dependency_links.txt plotly.egg-info/not-zip-safe plotly.egg-info/requires.txt plotly.egg-info/top_level.txt plotly/api/__init__.py plotly/api/utils.py plotly/api/v1/__init__.py plotly/api/v1/clientresp.py plotly/api/v1/utils.py plotly/api/v2/__init__.py plotly/api/v2/dash_apps.py plotly/api/v2/dashboards.py plotly/api/v2/files.py plotly/api/v2/folders.py plotly/api/v2/grids.py plotly/api/v2/images.py plotly/api/v2/plot_schema.py plotly/api/v2/plots.py plotly/api/v2/spectacle_presentations.py plotly/api/v2/users.py plotly/api/v2/utils.py plotly/dashboard_objs/__init__.py plotly/dashboard_objs/dashboard_objs.py plotly/figure_factory/_2d_density.py plotly/figure_factory/__init__.py plotly/figure_factory/_annotated_heatmap.py plotly/figure_factory/_bullet.py plotly/figure_factory/_candlestick.py plotly/figure_factory/_dendrogram.py plotly/figure_factory/_distplot.py plotly/figure_factory/_facet_grid.py plotly/figure_factory/_gantt.py plotly/figure_factory/_ohlc.py plotly/figure_factory/_quiver.py plotly/figure_factory/_scatterplot.py plotly/figure_factory/_streamline.py plotly/figure_factory/_table.py plotly/figure_factory/_trisurf.py plotly/figure_factory/_violin.py plotly/figure_factory/utils.py plotly/graph_objs/__init__.py plotly/graph_objs/graph_objs.py plotly/graph_objs/graph_objs_tools.py plotly/grid_objs/__init__.py plotly/grid_objs/grid_objs.py plotly/matplotlylib/__init__.py plotly/matplotlylib/mpltools.py plotly/matplotlylib/renderer.py plotly/matplotlylib/mplexporter/__init__.py plotly/matplotlylib/mplexporter/_py3k_compat.py plotly/matplotlylib/mplexporter/exporter.py plotly/matplotlylib/mplexporter/tools.py plotly/matplotlylib/mplexporter/utils.py plotly/matplotlylib/mplexporter/renderers/__init__.py plotly/matplotlylib/mplexporter/renderers/base.py plotly/matplotlylib/mplexporter/renderers/fake_renderer.py plotly/matplotlylib/mplexporter/renderers/vega_renderer.py plotly/matplotlylib/mplexporter/renderers/vincent_renderer.py plotly/offline/__init__.py plotly/offline/offline.py plotly/package_data/default-schema.json plotly/package_data/graphWidget.js plotly/package_data/plotly.min.js plotly/plotly/__init__.py plotly/plotly/plotly.py plotly/plotly/chunked_requests/__init__.py plotly/plotly/chunked_requests/chunked_request.py plotly/presentation_objs/__init__.py plotly/presentation_objs/presentation_objs.py plotly/widgets/__init__.py plotly/widgets/graph_widget.pyplotly-2.2.3+dfsg.orig/plotly.egg-info/PKG-INFO0000644000175000017500000001146513211605515020367 0ustar noahfxnoahfxMetadata-Version: 1.1 Name: plotly Version: 2.2.3 Summary: Python plotting library for collaborative, interactive, publication-quality graphs. Home-page: https://plot.ly/python/ Author: Chris P Author-email: chris@plot.ly License: MIT Description-Content-Type: UNKNOWN Description: ======= plotly: ======= -------------------------- It's all about the graphs. -------------------------- The Nutshell ~~~~~~~~~~~~ Use this package to make collaborative, interactive, publication-quality graphs from Python. Here's how you import:: import plotly.plotly as py # for sending things to plotly import plotly.tools as tls # for mpl, config, etc. from plotly.graph_objs import * # __all__ is safely defined Here's how you sign in:: py.sign_in('PythonAPI', 'ubpiol2cve') # get your own at https://plot.ly/ Here's how you plot data or a figure:: py.plot(data_or_figure_here) Here's what you get: * an account on plotly * a unique url for your data/figures * an interactive web-application to edit your figure or make new figures * a platform on which to share your data/figures with the world You can also convert supported matplotlib figures:: py.plot_mpl(mplfig) Stop fighting with your figures; start designing them. Check out our Quickstart_ to get going. About ~~~~~ Plotly_ is an online collaborative data analysis and graphing tool. The Python API allows you to access all of Plotly's functionality from Python. Plotly figures are shared, tracked, and edited all online and the data is always accessible from the graph. That's it. Find out more, sign up, and start sharing by visiting us at https://plot.ly. Install via pip ~~~~~~~~~~~~~~~ Assuming you have already installed pip, you can simply enter the following in a terminal program:: $ pip install plotly Contributing! ~~~~~~~~~~~~~ If you want to contribute to making Plotly's Python API experience better, head to our `GitHub repo`_. Instructions for installing from here, updating the included submodules, and contributing are detailed there! Plotly, matplotlib, and mpld3 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The matplotlylib sub-package allows you to convert matplotlib figures to plotly figures, with a one-liner:: py.plot_mpl(fig) Checkout the `Plotly and mpld3`_ IPython notebook for more information. Introduction to working with out API ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Checkout the `Plotly and Python`_ IPython notebook to get a more in depth exposition of our Python API. Plotly's *guide book* ~~~~~~~~~~~~~~~~~~~~~ Still here? Don't worry, we've got more documentation for you. Checkout a *highly* complete `set of notebooks`_ for walk-throughs on all the features we offer! Details ~~~~~~~ The plotly package depends on requests, which will be installed by pip for you. To use the matplotlylib subpackage, you'll also need to have matplotlib 1.3.1 properly installed on your machine. The matpotlylib package is based on the mplexporter framework for crawling and exporting matplotlib images. Created by: Plotly_, `@plotlygraphs`_, `feedback@plot.ly`_ License: MIT .. _Plotly: https://plot.ly .. _Quickstart: https://plot.ly/python .. _GitHub repo: https://github.com/plotly/python-api .. _Plotly and mpld3: https://plot.ly/python/matplotlib-to-plotly-tutorial/ .. _Plotly and Python: https://plot.ly/python/overview/ .. _set of notebooks: https://plot.ly/python/user-guide/ .. _plotly profile: https://plot.ly/~mpld3/ .. _@plotlygraphs: https://twitter.com/plotlygraphs .. _feedback@plot.ly: feedback@plot.ly Platform: UNKNOWN Classifier: Development Status :: 4 - Beta Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Topic :: Scientific/Engineering :: Visualization plotly-2.2.3+dfsg.orig/plotly.egg-info/requires.txt0000644000175000017500000000006113211605515021660 0ustar noahfxnoahfxdecorator>=4.0.6 nbformat>=4.2 pytz requests six plotly-2.2.3+dfsg.orig/setup.py0000644000175000017500000000353013174472664016000 0ustar noahfxnoahfxfrom setuptools import setup exec (open('plotly/version.py').read()) def readme(): with open('README.rst') as f: return f.read() setup(name='plotly', version=__version__, use_2to3=False, author='Chris P', author_email='chris@plot.ly', maintainer='Chris P', maintainer_email='chris@plot.ly', url='https://plot.ly/python/', description="Python plotting library for collaborative, " "interactive, publication-quality graphs.", long_description=readme(), classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Topic :: Scientific/Engineering :: Visualization', ], license='MIT', packages=['plotly', 'plotly/api', 'plotly/api/v1', 'plotly/api/v2', 'plotly/dashboard_objs', 'plotly/presentation_objs', 'plotly/plotly', 'plotly/plotly/chunked_requests', 'plotly/figure_factory', 'plotly/graph_objs', 'plotly/grid_objs', 'plotly/widgets', 'plotly/offline', 'plotly/matplotlylib', 'plotly/matplotlylib/mplexporter', 'plotly/matplotlylib/mplexporter/renderers'], package_data={'plotly': ['package_data/*']}, install_requires=['decorator>=4.0.6', 'nbformat>=4.2', 'pytz', 'requests', 'six'], zip_safe=False)