

@help(ChordBuilder)
def Chord(data, source=None, target=None, value=None, square_matrix=False, label=None, xgrid=False, ygrid=False, **kw):
    '\n    Create a chord chart using :class:`ChordBuilder <bokeh.charts.builders.chord_builder.ChordBuilder>`\n    to render a chord graph from a variety of value forms.\n    This chart displays the inter-relationships between data in a matrix.\n\n    The data can be generated by the chart interface. Given a :class:`DataFrame <pandas.DataFrame>`,\n    select two columns to be used as arcs with `source` and `target` attributes, passing by the name of those columns.\n    The :class:`Chord <bokeh.charts.builders.chord_builder.Chord>` chart will then deduce the\n    relationship between the arcs.\n\n    The value of the connections can be inferred automatically by counting `source` and `target`. If you prefer\n    you can assign a fixed value for all the connections with `value` simply passing by a number. A third option is to\n    pass a reference to a third column in the :class:`DataFrame <pandas.DataFrame>` with the values for the connections.\n\n    If you want to plot the relationships in a squared matrix, simply pass the matrix and set `square_matrix` attribute\n    to `True`.\n\n    Reference: `Chord diagram on Wikipedia <https://en.wikipedia.org/wiki/Chord_diagram>`_\n\n    Args:\n        data (:ref:`userguide_charts_data_types`): the data source for the chart.\n        source (list(str) or str, optional): Data source to use as origin of the connection to a destination.\n        target (list(str) or str, optional): Data source to use as destination of a connection.\n        value (list(num) or num, optional): The value the connection should have.\n        square_matrix (bool, optional): If square matrix, avoid any calculations during the setup.\n        label (list(str), optional): The labels to be put in the areas.\n\n    Returns:\n        :class:`Chart`: includes glyph renderers that generate the chord\n\n    Examples:\n\n    .. bokeh-plot::\n        :source-position: above\n\n        import pandas as pd\n        from bokeh.charts import Chord\n        from bokeh.io import show, output_file\n        from bokeh.sampledata.les_mis import data\n\n        nodes = data[\'nodes\']\n        links = data[\'links\']\n\n        nodes_df = pd.DataFrame(nodes)\n        links_df = pd.DataFrame(links)\n\n        source_data = links_df.merge(nodes_df, how=\'left\', left_on=\'source\', right_index=True)\n        source_data = source_data.merge(nodes_df, how=\'left\', left_on=\'target\', right_index=True)\n        source_data = source_data[source_data["value"] > 5]  # Select those with 5 or more connections\n\n        chord_from_df = Chord(source_data, source="name_x", target="name_y", value="value")\n        output_file(\'chord_from_df.html\')\n        show(chord_from_df)\n\n    '
    kw['origin'] = source
    kw['destination'] = target
    kw['value'] = value
    kw['square_matrix'] = square_matrix
    kw['label'] = label
    kw['xgrid'] = xgrid
    kw['ygrid'] = ygrid
    chart = create_and_build(ChordBuilder, data, **kw)
    chart.left[0].visible = False
    chart.below[0].visible = False
    chart.outline_line_color = None
    return chart

dataset/ETHPy150Open bokeh/bokeh/bokeh/charts/builders/chord_builder.py Chord/original