def produce_scattertext_explorer(corpus: object,
                                 category: object,
                                 category_name: object = None,
                                 not_category_name: object = None,
                                 protocol: object = 'https',
                                 pmi_threshold_coefficient: object = DEFAULT_MINIMUM_TERM_FREQUENCY,
                                 minimum_term_frequency: object = DEFAULT_PMI_THRESHOLD_COEFFICIENT,
                                 minimum_not_category_term_frequency: object = 0,
                                 max_terms: object = None,
                                 filter_unigrams: object = False,
                                 height_in_pixels: object = None,
                                 width_in_pixels: object = None,
                                 max_snippets: object = None,
                                 max_docs_per_category: object = None,
                                 metadata: object = None,
                                 scores: object = None,
                                 x_coords: object = None,
                                 y_coords: object = None,
                                 original_x: object = None,
                                 original_y: object = None,
                                 rescale_x: object = None,
                                 rescale_y: object = None,
                                 singleScoreMode: object = False,
                                 sort_by_dist: object = False,
                                 reverse_sort_scores_for_not_category: object = True,
                                 use_full_doc: object = False,
                                 transform: object = percentile_alphabetical,
                                 jitter: object = 0,
                                 gray_zero_scores: object = False,
                                 term_ranker: object = None,
                                 asian_mode: object = False,
                                 match_full_line: object = False,
                                 use_non_text_features: object = False,
                                 show_top_terms: object = True,
                                 show_characteristic: object = None,
                                 word_vec_use_p_vals: object = False,
                                 max_p_val: object = 0.1,
                                 p_value_colors: object = False,
                                 term_significance: object = None,
                                 save_svg_button: object = False,
                                 x_label: object = None,
                                 y_label: object = None,
                                 d3_url: object = None,
                                 d3_scale_chromatic_url: object = None,
                                 pmi_filter_thresold: object = None,
                                 alternative_text_field: object = None,
                                 terms_to_include: object = None,
                                 semiotic_square: object = None,
                                 num_terms_semiotic_square: object = None,
                                 not_categories: object = None,
                                 neutral_categories: object = [],
                                 extra_categories: object = [],
                                 show_neutral: object = False,
                                 neutral_category_name: object = None,
                                 get_tooltip_content: object = None,
                                 x_axis_values: object = None,
                                 y_axis_values: object = None,
                                 x_axis_values_format: object = None,
                                 y_axis_values_format: object = None,
                                 color_func: object = None,
                                 term_scorer: object = None,
                                 term_scorer_kwargs: object = None,
                                 show_axes: object = True,
                                 show_axes_and_cross_hairs: object = False,
                                 show_diagonal: object = False,
                                 use_global_scale: object = False,
                                 horizontal_line_y_position: object = None,
                                 vertical_line_x_position: object = None,
                                 show_cross_axes: object = True,
                                 show_extra: object = False,
                                 extra_category_name: object = None,
                                 censor_points: object = True,
                                 center_label_over_points: object = False,
                                 x_axis_labels: object = None,
                                 y_axis_labels: object = None,
                                 topic_model_term_lists: object = None,
                                 topic_model_preview_size: object = 10,
                                 metadata_descriptions: object = None,
                                 vertical_lines: object = None,
                                 characteristic_scorer: object = None,
                                 term_colors: object = None,
                                 unified_context: object = False,
                                 show_category_headings: object = True,
                                 highlight_selected_category: object = False,
                                 include_term_category_counts: object = False,
                                 div_name: object = None,
                                 alternative_term_func: object = None,
                                 term_metadata: object = None,
                                 term_metadata_df: object = None,
                                 max_overlapping: object = -1,
                                 include_all_contexts: object = False,
                                 show_corpus_stats: object = True,
                                 sort_doc_labels_by_name: object = False,
                                 enable_term_category_description: object = True,
                                 always_jump: object = True,
                                 get_custom_term_html: object = None,
                                 header_names: object = None,
                                 header_sorting_algos: object = None,
                                 ignore_categories: object = False,
                                 d3_color_scale: object = None,
                                 background_labels: object = None,
                                 tooltip_columns: object = None,
                                 tooltip_column_names: object = None,
                                 term_description_columns: object = None,
                                 term_description_column_names: object = None,
                                 term_word_in_term_description: object = 'Term',
                                 color_column: object = None,
                                 color_score_column: object = None,
                                 label_priority_column: object = None,
                                 text_color_column: object = None,
                                 text_size_column: object = None,
                                 suppress_text_column: object = None,
                                 background_color: object = None,
                                 left_list_column: object = None,
                                 censor_point_column: object = None,
                                 right_order_column: object = None,
                                 line_coordinates: object = None,
                                 subword_encoding: object = None,
                                 top_terms_length: object = 14,
                                 top_terms_left_buffer: object = 0,
                                 dont_filter: object = False,
                                 use_offsets: object = False,
                                 get_column_header_html: object = None,
                                 show_term_etc: object = True,
                                 sort_contexts_by_meta: object = False,
                                 show_chart: object = False,
                                 return_data: object = False,
                                 suppress_circles: object = False,
                                 category_colors: object = None,
                                 document_word: object = "document",
                                 document_word_plural: object = None,
                                 category_order: object = None,
                                 include_gradient: bool = False,
                                 left_gradient_term: Optional[str] = None,
                                 middle_gradient_term: Optional[str] = None,
                                 right_gradient_term: Optional[str] = None,
                                 gradient_text_color: Optional[str] = None,
                                 gradient_colors: Optional[List[str]] = None,
                                 category_term_scores: Optional[list[List[float]]] = None,
                                 category_term_score_scaler: Optional[str] = None,
                                 return_scatterplot_structure: object = False) -> object:
    '''Returns html code of visualization.

    Parameters
    ----------
    corpus : Corpus
        Corpus to use.
    category : str
        Name of category column as it appears in original data frame.
    category_name : str
        Name of category to use.  E.g., "5-star reviews."
        Optional, defaults to category name.
    not_category_name : str
        Name of everything that isn't in category.  E.g., "Below 5-star reviews".
        Optional defaults to "N(n)ot " + category_name, with the case of the 'n' dependent
        on the case of the first letter in category_name.
    protocol : str, optional
        Protocol to use.  Either http or https.  Default is https.
    pmi_threshold_coefficient : int, optional
        Filter out bigrams with a PMI of < 2 * pmi_threshold_coefficient. Default is 6
    minimum_term_frequency : int, optional
        Minimum number of times word needs to appear to make it into visualization.
    minimum_not_category_term_frequency : int, optional
      If an n-gram does not occur in the category, minimum times it
       must be seen to be included. Default is 0.
    max_terms : int, optional
        Maximum number of terms to include in visualization.
    filter_unigrams : bool, optional
        Default False, do we filter out unigrams that only occur in one bigram
    width_in_pixels : int, optional
        Width of viz in pixels, if None, default to JS's choice
    height_in_pixels : int, optional
        Height of viz in pixels, if None, default to JS's choice
    max_snippets : int, optional
        Maximum number of snippets to show when term is clicked.  If None, all are shown.
    max_docs_per_category: int, optional
        Maximum number of documents to store per category.  If None, by default, all are stored.
    metadata : list or function, optional
        list of meta data strings that will be included for each document, if a function, called on corpus
    scores : np.array, optional
        Array of term scores or None.
    x_coords : np.array, optional
        Array of term x-axis positions or None.  Must be in [0,1].
        If present, y_coords must also be present.
    y_coords : np.array, optional
        Array of term y-axis positions or None.  Must be in [0,1].
        If present, x_coords must also be present.
    original_x : array-like
        Original, unscaled x-values.  Defaults to x_coords
    original_y : array-like
        Original, unscaled y-values.  Defaults to y_coords
    rescale_x : lambda list[0,1]: list[0,1], optional
        Array of term x-axis positions or None.  Must be in [0,1].
        Rescales x-axis after filtering
    rescale_y : lambda list[0,1]: list[0,1], optional
        Array of term y-axis positions or None.  Must be in [0,1].
        Rescales y-axis after filtering
    singleScoreMode : bool, optional
        Label terms based on score vs distance from corner.  Good for topic scores. Show only one color.
    sort_by_dist: bool, optional
        Label terms based distance from corner. True by default.  Negated by singleScoreMode.
    reverse_sort_scores_for_not_category: bool, optional
        If using a custom score, score the not-category class by
        lowest-score-as-most-predictive. Turn this off for word vector
        or topic similarity. Default True.
    use_full_doc : bool, optional
        Use the full document in snippets.  False by default.
    transform : function, optional
        not recommended for editing.  change the way terms are ranked.  default is st.Scalers.percentile_ordinal
    jitter : float, optional
        percentage of axis to jitter each point.  default is 0.
    gray_zero_scores : bool, optional
        If True, color points with zero-scores a light shade of grey.  False by default.
    term_ranker : TermRanker, optional
        TermRanker class for determining term frequency ranks.
    asian_mode : bool, optional
        Use a special Javascript regular expression that's specific to chinese or japanese
    match_full_line : bool, optional
        Has the javascript regex match the full line instead of part of it
    use_non_text_features : bool, optional
        Show non-bag-of-words features (e.g., Empath) instead of text.  False by default.
    show_top_terms : bool, default True
        Show top terms on the left-hand side of the visualization
    show_characteristic: bool, default None
        Show characteristic terms on the far left-hand side of the visualization
    word_vec_use_p_vals: bool, default False
        Sort by harmonic mean of score and distance.
    max_p_val : float, default 0.1
        If word_vec_use_p_vals, the minimum p val to use.
    p_value_colors : bool, default False
      Color points differently if p val is above 1-max_p_val, below max_p_val, or
       in between.
    term_significance : TermSignificance instance or None
        Way of getting signfiance scores.  If None, p values will not be added.
    save_svg_button : bool, default False
        Add a save as SVG button to the page.
    x_label : str, default None
        Custom x-axis label
    y_label : str, default None
        Custom y-axis label
    d3_url, str, None by default.  The url (or path) of d3.
        URL of d3, to be inserted into <script src="..."/>.  Overrides `protocol`.
      By default, this is `DEFAULT_D3_URL` declared in `ScatterplotStructure`.
    d3_scale_chromatic_url, str, None by default.  Overrides `protocol`.
      URL of d3 scale chromatic, to be inserted into <script src="..."/>
      By default, this is `DEFAULT_D3_SCALE_CHROMATIC` declared in `ScatterplotStructure`.
    pmi_filter_thresold : (DEPRECATED) int, None by default
      DEPRECATED.  Use pmi_threshold_coefficient instead.
    alternative_text_field : str or None, optional
        Field in from dataframe used to make corpus to display in place of parsed text. Only
        can be used if corpus is a ParsedCorpus instance.
    terms_to_include : list or None, optional
        Whitelist of terms to include in visualization.
    semiotic_square : SemioticSquareBase
        None by default.  SemioticSquare based on corpus.  Includes square above visualization.
    num_terms_semiotic_square : int
        10 by default. Number of terms to show in semiotic square.
        Only active if semiotic square is present.
    not_categories : list
        All categories other than category by default.  Documents labeled
        with remaining category.
    neutral_categories : list
        [] by default.  Documents labeled neutral.
    extra_categories : list
        [] by default.  Documents labeled extra.
    show_neutral : bool
        False by default.  Show a third column listing contexts in the
        neutral categories.
    neutral_category_name : str
        "Neutral" by default. Only active if show_neutral is True.  Name of the neutral
        column.
    get_tooltip_content : str
        Javascript function to control content of tooltip.  Function takes a parameter
        which is a dictionary entry produced by `ScatterChartExplorer.to_dict` and
        returns a string.
    x_axis_values : list, default None
        Value-labels to show on x-axis. Low, medium, high are defaults.
    y_axis_values : list, default None
        Value-labels to show on y-axis. Low, medium, high are defaults.
    x_axis_values_format : str, default None
        d3 format of x-axis values
    y_axis_values_format : str, default None
        d3 format of y-axis values
    color_func : str, default None
        Javascript function to control color of a point.  Function takes a parameter
        which is a dictionary entry produced by `ScatterChartExplorer.to_dict` and
        returns a string.
    term_scorer : Object, default None
        In lieu of scores, object with a get_scores(a,b) function that returns a set of scores,
        where a and b are term counts.  Scorer optionally has a get_term_freqs function. Also could be a
        CorpusBasedTermScorer instance.
    term_scorer_kwargs : Optional[Dict], default None
        Arguments to be placed in the term_scorer constructor after the corpus
    show_axes : bool, default True
        Show the ticked axes on the plot.  If false, show inner axes as a crosshair.
    show_axes_and_cross_hairs : bool, default False
        Show both peripheral axis labels and cross axes.
    show_diagonal : bool, default False
        Show a diagonal line leading from the lower-left ot the upper-right; only makes
        sense to use this if use_global_scale is true.
    use_global_scale : bool, default False
        Use same scale for both axes
    vertical_line_x_position : float, default None
    horizontal_line_y_position : float, default None
    show_cross_axes : bool, default True
        If show_axes is False, do we show cross-axes?
    show_extra : bool
        False by default.  Show a fourth column listing contexts in the
        extra categories.
    extra_category_name : str, default None
        "Extra" by default. Only active if show_neutral is True and show_extra is True.  Name
        of the extra column.
    censor_points : bool, default True
        Don't label over points.
    center_label_over_points : bool, default False
        Center a label over points, or try to find a position near a point that
        doesn't overlap anything else.
    x_axis_labels: list, default None
        List of string value-labels to show at evenly spaced intervals on the x-axis.
        Low, medium, high are defaults.
    y_axis_labels : list, default None
        List of string value-labels to show at evenly spaced intervals on the y-axis.
        Low, medium, high are defaults.
    topic_model_term_lists : dict default None
        Dict of metadata name (str) -> List of string terms in metadata. These will be bolded
        in query in context results.
    topic_model_preview_size : int default 10
        Number of terms in topic model to show as a preview.
    metadata_descriptions : dict default None
        Dict of metadata name (str) -> str of metadata description. These will be shown when a meta data term is
        clicked.
    vertical_lines : list default None
        List of floats corresponding to points on the x-axis to draw vertical lines
    characteristic_scorer : CharacteristicScorer default None
        Used for bg scores
    term_colors : dict, default None
        Dictionary mapping term to color
    unified_context : bool, default False
        Boolean displays contexts in a single pane as opposed to separate columns.
    show_category_headings : bool, default True
        Show category headings if unified_context is True.
    highlight_selected_category : bool, default False
        Highlight selected category if unified_context is True.
    include_term_category_counts : bool, default False
        Include the termCounts object in the plot definition.
    div_name : str, None by default
        Give the scatterplot div name a non-default value
    alternative_term_func: str, default None
        Javascript function which take a term JSON object and returns a bool.  If the return value is true,
        execute standard term click pipeline. Ex.: `'(function(termDict) {return true;})'`.
    term_metadata : dict, None by default
        Dict mapping terms to dictionaries containing additional information which can be used in the color_func
        or the get_tooltip_content function. These will appear in termDict.etc
    term_metadata_df : pd.DataFrame, None by default
        Dataframe version of term_metadata
    include_all_contexts: bool, default False
        Include all contexts, even non-matching ones, in interface
    max_overlapping: int, default -1
        Number of overlapping terms to dislay. If -1, display all. (default)
    show_corpus_stats: bool, default True
        Show the corpus stats div
    sort_doc_labels_by_name: bool default False
        If unified, sort the document labels by name
    always_jump: bool, default True
        Always jump to term contexts if a term is clicked
    enable_term_category_description: bool, default True
        List term/metadata statistics under category
    get_custom_term_html: str, default None
        Javascript function which displays term summary from term info
    header_names: Dict[str, str], default None
        Dictionary giving names of term lists shown to the right of the plot. Valid keys are
        upper, lower and right.
    header_sorting_algos: Dict[str, str], default None
        Dictionary giving javascript sorting algorithms for panes. Valid keys are upper, lower
        and right. Value is a JS function which takes the "data" object.
    ignore_categories: bool, default False
        Signals the plot shouldn't display category names. Used in single category plots.
    suppress_text_column: str, default None
        Column in term_metadata_df which indicates term should be hidden
    left_list_column: str, default None
        Column in term_metadata_df which should be used for sorting words into upper and lower
        parts of left word-list sections. Highest values in upper, lowest in lower.
    tooltip_columns: List[str]
    tooltip_column_names: Dict[str, str]
    term_description_columns: List[str]
    term_description_column_names: Dict[str]
    term_word_in_term_description: str, default None
    color_column: str, default None:
        column in term_metadata_df which indicates color
    color_score_column: str, default None
        column in term_metadata df; contains value between 0 and 1 which will be used to assign a color
    label_priority_column : str, default None
        Column in term_metadata_df; larger values in the column indicate a term should be labeled first
    censor_point_column : str, default None
        Should we allow labels to be drawn over point?
    right_order_column : str, default None
        Order for right column ("characteristic" by default); largest first
    background_color : str, default None
        Changes document.body's background color to background_color
    line_coordinates : list, default None
        Coordinates for drawing a line under the plot
    subword_encoding : str, default None
        Type of subword encoding to use, None if none, currently supports "RoBERTa"
    top_terms_length : int, default 14
        Number of words to list in most/least associated lists on left-hand side
    top_terms_left_buffer : int, default 0
        Number of pixels left to shift top terms list
    dont_filter : bool, default False
        Don't filter any terms when charting
    get_column_header_html : str, default None
        Javascript function to return html over each column. Matches header
        (Column Name, occurrences per 25k, occs, # occs * 1000/num docs, term info)
    show_term_etc: bool, default True
        Shows list of etc values after clicking term
    use_offsets : bool, default False
        Enable the use of metadata offsets
    sort_contexts_by_meta : bool, default False
        Sort context by meta instead of match strength
    suppress_circles : bool, default False
        Label terms over circles and hide circless
    show_chart : bool, default False
        Show line chart if unified context is true
    return_data : bool default False
        Return a dict containing the output of `ScatterChartExplosrer.to_dict` instead of
        an html.
    category_colors : dict, optional defaut None
        Dictionary matching category names to colors
    document_word : str, default "document"
    document_word_plural : Optional[str], default "document"
    category_order : Optional[list[str]], default None
        Order of categories in line chart
    include_gradient : bool, False
        Include gradient at the top of the chart
    left_gradient_term : Optional[str], None by default
        Text of left gradient label. category_name by default
    middle_gradient_term : Optional[str], None by default
        Text of middle grad label. If None, not shown.
    right_gradient_term: Optional[str], None by default
        Text of right gradient label, not_category_name by default
    gradient_text_color: str, white by default
        Color of text in gradient
    gradient_colors: Optional[List[str]], None by default, follows d3_color_scale
        Colors of gradient, as a list of hex values (e.g, ['#0000ff', '#fe0100', '#00ff00'])
    category_term_scores: Optional[List[List[float]], None by default
        score[category, term] for table visualization
    category_term_score_scaler: Optional[str], None by default
        Javascript function which scales a set of categories scores to between 0 and 1
    return_scatterplot_structure : bool, default False
        return ScatterplotStructure instead of html

    Returns
    -------
    str
    html of visualization

    '''
    if singleScoreMode or word_vec_use_p_vals:
        d3_color_scale = 'd3.interpolatePurples'
    if singleScoreMode or not sort_by_dist:
        sort_by_dist = False
    else:
        sort_by_dist = True
    if term_ranker is None:
        term_ranker = termranking.AbsoluteFrequencyRanker

    category_name, not_category_name = get_category_names(category, category_name, not_categories, not_category_name)

    if not_categories is None:
        not_categories = [c for c in corpus.get_categories() if c != category]

    term_scorer = _initialize_term_scorer_if_needed(category, corpus, neutral_categories, not_categories, show_neutral,
                                                    term_scorer, use_non_text_features, term_ranker, term_scorer_kwargs)

    if term_scorer:
        scores = get_term_scorer_scores(category, corpus, neutral_categories, not_categories, show_neutral, term_ranker,
                                        term_scorer, use_non_text_features)

    if pmi_filter_thresold is not None:
        pmi_threshold_coefficient = pmi_filter_thresold
        warnings.warn(
            "The argument name 'pmi_filter_thresold' has been deprecated. Use 'pmi_threshold_coefficient' in its place",
            DeprecationWarning)

    if use_non_text_features:
        pmi_threshold_coefficient = 0

    scatter_chart_explorer = ScatterChartExplorer(
        corpus,
        minimum_term_frequency=minimum_term_frequency,
        minimum_not_category_term_frequency=minimum_not_category_term_frequency,
        pmi_threshold_coefficient=pmi_threshold_coefficient,
        filter_unigrams=filter_unigrams,
        jitter=jitter,
        max_terms=max_terms,
        term_ranker=term_ranker,
        use_non_text_features=use_non_text_features,
        term_significance=term_significance,
        terms_to_include=terms_to_include,
        dont_filter=dont_filter
    )
    if ((x_coords is None and y_coords is not None)
            or (y_coords is None and x_coords is not None)):
        raise Exception("Both x_coords and y_coords need to be passed or both left blank")
    if x_coords is not None:
        scatter_chart_explorer.inject_coordinates(x_coords,
                                                  y_coords,
                                                  rescale_x=rescale_x,
                                                  rescale_y=rescale_y,
                                                  original_x=original_x,
                                                  original_y=original_y)
    if topic_model_term_lists is not None:
        scatter_chart_explorer.inject_metadata_term_lists(topic_model_term_lists)
    if metadata_descriptions is not None:
        scatter_chart_explorer.inject_metadata_descriptions(metadata_descriptions)
    if term_colors is not None:
        scatter_chart_explorer.inject_term_colors(term_colors)
        if color_func is None:
            color_func = "(function(d) {return modelInfo.term_colors[d.term]})"
    if term_metadata_df is not None and term_metadata is not None:
        raise Exception("Both term_metadata_df and term_metadata cannot be values which are not None.")
    if term_metadata_df is not None:
        scatter_chart_explorer.inject_term_metadata_df(term_metadata_df)
    if term_metadata is not None:
        scatter_chart_explorer.inject_term_metadata(term_metadata)
    html_base = None
    if semiotic_square:
        html_base = get_semiotic_square_html(num_terms_semiotic_square,
                                             semiotic_square)

    if category_term_scores is not None:
        scatter_chart_explorer.inject_category_scores(category_scores=category_term_scores)

    scatter_chart_data = scatter_chart_explorer.to_dict(
        category=category,
        category_name=category_name,
        not_category_name=not_category_name,
        not_categories=not_categories,
        transform=transform,
        scores=scores,
        max_docs_per_category=max_docs_per_category,
        metadata=metadata if not callable(metadata) else metadata(corpus),
        alternative_text_field=alternative_text_field,
        neutral_category_name=neutral_category_name,
        extra_category_name=extra_category_name,
        neutral_categories=neutral_categories,
        extra_categories=extra_categories,
        background_scorer=characteristic_scorer,
        include_term_category_counts=include_term_category_counts,
        use_offsets=use_offsets
    )

    if line_coordinates is not None:
        scatter_chart_data['line'] = line_coordinates

    if return_data:
        return scatter_chart_data

    if tooltip_columns is not None:
        assert get_tooltip_content is None
        get_tooltip_content = get_tooltip_js_function(
            term_metadata_df,
            tooltip_column_names,
            tooltip_columns
        )

    if term_description_columns is not None:
        assert get_custom_term_html is None
        get_custom_term_html = get_custom_term_info_js_function(
            term_metadata_df,
            term_description_column_names,
            term_description_columns,
            term_word_in_term_description
        )

    if color_column:
        assert color_func is None
        color_func = '(function(d) {return d.etc["%s"]})' % color_column

    if color_score_column:
        assert color_func is None
        color_func = '(function(d) {return %s(d.etc["%s"])})' % (
            d3_color_scale if d3_color_scale is not None else 'd3.interpolateRdYlBu',
            color_score_column
        )

    if header_sorting_algos is not None:
        assert 'upper' in header_sorting_algos
        assert 'lower' in header_sorting_algos
    if left_list_column is not None:
        assert term_metadata_df is not None
        assert left_list_column in term_metadata_df
        header_sorting_algos = {
            "upper": '((a,b) => b.etc["' + left_list_column + '"] - a.etc["' + left_list_column + '"])',
            "lower": '((a,b) => a.etc["' + left_list_column + '"] - b.etc["' + left_list_column + '"])'
        }
    if right_order_column is not None:
        assert right_order_column in term_metadata_df

    if show_characteristic is None:
        show_characteristic = not (asian_mode or use_non_text_features)

    scatterplot_structure = ScatterplotStructure(
        VizDataAdapter(scatter_chart_data),
        width_in_pixels=width_in_pixels,
        height_in_pixels=height_in_pixels,
        max_snippets=max_snippets,
        color=d3_color_scale,
        grey_zero_scores=gray_zero_scores,
        sort_by_dist=sort_by_dist,
        reverse_sort_scores_for_not_category=reverse_sort_scores_for_not_category,
        use_full_doc=use_full_doc,
        asian_mode=asian_mode,
        match_full_line=match_full_line,
        use_non_text_features=use_non_text_features,
        show_characteristic=show_characteristic,
        word_vec_use_p_vals=word_vec_use_p_vals,
        max_p_val=max_p_val,
        save_svg_button=save_svg_button,
        p_value_colors=p_value_colors,
        x_label=x_label,
        y_label=y_label,
        show_top_terms=show_top_terms,
        show_neutral=show_neutral,
        get_tooltip_content=get_tooltip_content,
        x_axis_values=x_axis_values,
        y_axis_values=y_axis_values,
        color_func=color_func,
        show_axes=show_axes,
        horizontal_line_y_position=horizontal_line_y_position,
        vertical_line_x_position=vertical_line_x_position,
        show_extra=show_extra,
        do_censor_points=censor_points,
        center_label_over_points=center_label_over_points,
        x_axis_labels=x_axis_labels,
        y_axis_labels=y_axis_labels,
        topic_model_preview_size=topic_model_preview_size,
        vertical_lines=vertical_lines,
        unified_context=unified_context,
        show_category_headings=show_category_headings,
        highlight_selected_category=highlight_selected_category,
        show_cross_axes=show_cross_axes,
        div_name=div_name,
        alternative_term_func=alternative_term_func,
        include_all_contexts=include_all_contexts,
        show_axes_and_cross_hairs=show_axes_and_cross_hairs,
        show_diagonal=show_diagonal,
        use_global_scale=use_global_scale,
        x_axis_values_format=x_axis_values_format,
        y_axis_values_format=y_axis_values_format,
        max_overlapping=max_overlapping,
        show_corpus_stats=show_corpus_stats,
        sort_doc_labels_by_name=sort_doc_labels_by_name,
        enable_term_category_description=enable_term_category_description,
        always_jump=always_jump,
        get_custom_term_html=get_custom_term_html,
        header_names=header_names,
        header_sorting_algos=header_sorting_algos,
        ignore_categories=ignore_categories,
        background_labels=background_labels,
        label_priority_column=label_priority_column,
        text_color_column=text_color_column,
        text_size_column=text_size_column,
        suppress_text_column=suppress_text_column,
        background_color=background_color,
        censor_point_column=censor_point_column,
        right_order_column=right_order_column,
        subword_encoding=subword_encoding,
        top_terms_length=top_terms_length,
        top_terms_left_buffer=top_terms_left_buffer,
        get_column_header_html=get_column_header_html,
        term_word=term_word_in_term_description,
        show_term_etc=show_term_etc,
        sort_contexts_by_meta=sort_contexts_by_meta,
        suppress_circles=suppress_circles,
        category_colors=category_colors,
        document_word=document_word,
        document_word_plural=document_word_plural,
        category_order=category_order,
        include_gradient=include_gradient,
        left_gradient_term=left_gradient_term,
        middle_gradient_term=middle_gradient_term,
        right_gradient_term=right_gradient_term,
        gradient_text_color=gradient_text_color,
        gradient_colors=gradient_colors,
        category_term_score_scaler=category_term_score_scaler,
        show_chart=show_chart
    )

    if return_scatterplot_structure:
        return scatterplot_structure

    return (BasicHTMLFromScatterplotStructure(scatterplot_structure)
            .to_html(protocol=protocol,
                     d3_url=d3_url,
                     d3_scale_chromatic_url=d3_scale_chromatic_url,
                     html_base=html_base))
Returns html code of visualization.

    Parameters
    ----------
    corpus : Corpus
        Corpus to use.
    category : str
        Name of category column as it appears in original data frame.
    category_name : str
        Name of category to use.  E.g., "5-star reviews."
        Optional, defaults to category name.
    not_category_name : str
        Name of everything that isn't in category.  E.g., "Below 5-star reviews".
        Optional defaults to "N(n)ot " + category_name, with the case of the 'n' dependent
        on the case of the first letter in category_name.
    protocol : str, optional
        Protocol to use.  Either http or https.  Default is https.
    pmi_threshold_coefficient : int, optional
        Filter out bigrams with a PMI of < 2 * pmi_threshold_coefficient. Default is 6
    minimum_term_frequency : int, optional
        Minimum number of times word needs to appear to make it into visualization.
    minimum_not_category_term_frequency : int, optional
      If an n-gram does not occur in the category, minimum times it
       must be seen to be included. Default is 0.
    max_terms : int, optional
        Maximum number of terms to include in visualization.
    filter_unigrams : bool, optional
        Default False, do we filter out unigrams that only occur in one bigram
    width_in_pixels : int, optional
        Width of viz in pixels, if None, default to JS's choice
    height_in_pixels : int, optional
        Height of viz in pixels, if None, default to JS's choice
    max_snippets : int, optional
        Maximum number of snippets to show when term is clicked.  If None, all are shown.
    max_docs_per_category: int, optional
        Maximum number of documents to store per category.  If None, by default, all are stored.
    metadata : list or function, optional
        list of meta data strings that will be included for each document, if a function, called on corpus
    scores : np.array, optional
        Array of term scores or None.
    x_coords : np.array, optional
        Array of term x-axis positions or None.  Must be in [0,1].
        If present, y_coords must also be present.
    y_coords : np.array, optional
        Array of term y-axis positions or None.  Must be in [0,1].
        If present, x_coords must also be present.
    original_x : array-like
        Original, unscaled x-values.  Defaults to x_coords
    original_y : array-like
        Original, unscaled y-values.  Defaults to y_coords
    rescale_x : lambda list[0,1]: list[0,1], optional
        Array of term x-axis positions or None.  Must be in [0,1].
        Rescales x-axis after filtering
    rescale_y : lambda list[0,1]: list[0,1], optional
        Array of term y-axis positions or None.  Must be in [0,1].
        Rescales y-axis after filtering
    singleScoreMode : bool, optional
        Label terms based on score vs distance from corner.  Good for topic scores. Show only one color.
    sort_by_dist: bool, optional
        Label terms based distance from corner. True by default.  Negated by singleScoreMode.
    reverse_sort_scores_for_not_category: bool, optional
        If using a custom score, score the not-category class by
        lowest-score-as-most-predictive. Turn this off for word vector
        or topic similarity. Default True.
    use_full_doc : bool, optional
        Use the full document in snippets.  False by default.
    transform : function, optional
        not recommended for editing.  change the way terms are ranked.  default is st.Scalers.percentile_ordinal
    jitter : float, optional
        percentage of axis to jitter each point.  default is 0.
    gray_zero_scores : bool, optional
        If True, color points with zero-scores a light shade of grey.  False by default.
    term_ranker : TermRanker, optional
        TermRanker class for determining term frequency ranks.
    asian_mode : bool, optional
        Use a special Javascript regular expression that's specific to chinese or japanese
    match_full_line : bool, optional
        Has the javascript regex match the full line instead of part of it
    use_non_text_features : bool, optional
        Show non-bag-of-words features (e.g., Empath) instead of text.  False by default.
    show_top_terms : bool, default True
        Show top terms on the left-hand side of the visualization
    show_characteristic: bool, default None
        Show characteristic terms on the far left-hand side of the visualization
    word_vec_use_p_vals: bool, default False
        Sort by harmonic mean of score and distance.
    max_p_val : float, default 0.1
        If word_vec_use_p_vals, the minimum p val to use.
    p_value_colors : bool, default False
      Color points differently if p val is above 1-max_p_val, below max_p_val, or
       in between.
    term_significance : TermSignificance instance or None
        Way of getting signfiance scores.  If None, p values will not be added.
    save_svg_button : bool, default False
        Add a save as SVG button to the page.
    x_label : str, default None
        Custom x-axis label
    y_label : str, default None
        Custom y-axis label
    d3_url, str, None by default.  The url (or path) of d3.
        URL of d3, to be inserted into <script src="..."/>.  Overrides `protocol`.
      By default, this is `DEFAULT_D3_URL` declared in `ScatterplotStructure`.
    d3_scale_chromatic_url, str, None by default.  Overrides `protocol`.
      URL of d3 scale chromatic, to be inserted into <script src="..."/>
      By default, this is `DEFAULT_D3_SCALE_CHROMATIC` declared in `ScatterplotStructure`.
    pmi_filter_thresold : (DEPRECATED) int, None by default
      DEPRECATED.  Use pmi_threshold_coefficient instead.
    alternative_text_field : str or None, optional
        Field in from dataframe used to make corpus to display in place of parsed text. Only
        can be used if corpus is a ParsedCorpus instance.
    terms_to_include : list or None, optional
        Whitelist of terms to include in visualization.
    semiotic_square : SemioticSquareBase
        None by default.  SemioticSquare based on corpus.  Includes square above visualization.
    num_terms_semiotic_square : int
        10 by default. Number of terms to show in semiotic square.
        Only active if semiotic square is present.
    not_categories : list
        All categories other than category by default.  Documents labeled
        with remaining category.
    neutral_categories : list
        [] by default.  Documents labeled neutral.
    extra_categories : list
        [] by default.  Documents labeled extra.
    show_neutral : bool
        False by default.  Show a third column listing contexts in the
        neutral categories.
    neutral_category_name : str
        "Neutral" by default. Only active if show_neutral is True.  Name of the neutral
        column.
    get_tooltip_content : str
        Javascript function to control content of tooltip.  Function takes a parameter
        which is a dictionary entry produced by `ScatterChartExplorer.to_dict` and
        returns a string.
    x_axis_values : list, default None
        Value-labels to show on x-axis. Low, medium, high are defaults.
    y_axis_values : list, default None
        Value-labels to show on y-axis. Low, medium, high are defaults.
    x_axis_values_format : str, default None
        d3 format of x-axis values
    y_axis_values_format : str, default None
        d3 format of y-axis values
    color_func : str, default None
        Javascript function to control color of a point.  Function takes a parameter
        which is a dictionary entry produced by `ScatterChartExplorer.to_dict` and
        returns a string.
    term_scorer : Object, default None
        In lieu of scores, object with a get_scores(a,b) function that returns a set of scores,
        where a and b are term counts.  Scorer optionally has a get_term_freqs function. Also could be a
        CorpusBasedTermScorer instance.
    term_scorer_kwargs : Optional[Dict], default None
        Arguments to be placed in the term_scorer constructor after the corpus
    show_axes : bool, default True
        Show the ticked axes on the plot.  If false, show inner axes as a crosshair.
    show_axes_and_cross_hairs : bool, default False
        Show both peripheral axis labels and cross axes.
    show_diagonal : bool, default False
        Show a diagonal line leading from the lower-left ot the upper-right; only makes
        sense to use this if use_global_scale is true.
    use_global_scale : bool, default False
        Use same scale for both axes
    vertical_line_x_position : float, default None
    horizontal_line_y_position : float, default None
    show_cross_axes : bool, default True
        If show_axes is False, do we show cross-axes?
    show_extra : bool
        False by default.  Show a fourth column listing contexts in the
        extra categories.
    extra_category_name : str, default None
        "Extra" by default. Only active if show_neutral is True and show_extra is True.  Name
        of the extra column.
    censor_points : bool, default True
        Don't label over points.
    center_label_over_points : bool, default False
        Center a label over points, or try to find a position near a point that
        doesn't overlap anything else.
    x_axis_labels: list, default None
        List of string value-labels to show at evenly spaced intervals on the x-axis.
        Low, medium, high are defaults.
    y_axis_labels : list, default None
        List of string value-labels to show at evenly spaced intervals on the y-axis.
        Low, medium, high are defaults.
    topic_model_term_lists : dict default None
        Dict of metadata name (str) -> List of string terms in metadata. These will be bolded
        in query in context results.
    topic_model_preview_size : int default 10
        Number of terms in topic model to show as a preview.
    metadata_descriptions : dict default None
        Dict of metadata name (str) -> str of metadata description. These will be shown when a meta data term is
        clicked.
    vertical_lines : list default None
        List of floats corresponding to points on the x-axis to draw vertical lines
    characteristic_scorer : CharacteristicScorer default None
        Used for bg scores
    term_colors : dict, default None
        Dictionary mapping term to color
    unified_context : bool, default False
        Boolean displays contexts in a single pane as opposed to separate columns.
    show_category_headings : bool, default True
        Show category headings if unified_context is True.
    highlight_selected_category : bool, default False
        Highlight selected category if unified_context is True.
    include_term_category_counts : bool, default False
        Include the termCounts object in the plot definition.
    div_name : str, None by default
        Give the scatterplot div name a non-default value
    alternative_term_func: str, default None
        Javascript function which take a term JSON object and returns a bool.  If the return value is true,
        execute standard term click pipeline. Ex.: `'(function(termDict) {return true;})'`.
    term_metadata : dict, None by default
        Dict mapping terms to dictionaries containing additional information which can be used in the color_func
        or the get_tooltip_content function. These will appear in termDict.etc
    term_metadata_df : pd.DataFrame, None by default
        Dataframe version of term_metadata
    include_all_contexts: bool, default False
        Include all contexts, even non-matching ones, in interface
    max_overlapping: int, default -1
        Number of overlapping terms to dislay. If -1, display all. (default)
    show_corpus_stats: bool, default True
        Show the corpus stats div
    sort_doc_labels_by_name: bool default False
        If unified, sort the document labels by name
    always_jump: bool, default True
        Always jump to term contexts if a term is clicked
    enable_term_category_description: bool, default True
        List term/metadata statistics under category
    get_custom_term_html: str, default None
        Javascript function which displays term summary from term info
    header_names: Dict[str, str], default None
        Dictionary giving names of term lists shown to the right of the plot. Valid keys are
        upper, lower and right.
    header_sorting_algos: Dict[str, str], default None
        Dictionary giving javascript sorting algorithms for panes. Valid keys are upper, lower
        and right. Value is a JS function which takes the "data" object.
    ignore_categories: bool, default False
        Signals the plot shouldn't display category names. Used in single category plots.
    suppress_text_column: str, default None
        Column in term_metadata_df which indicates term should be hidden
    left_list_column: str, default None
        Column in term_metadata_df which should be used for sorting words into upper and lower
        parts of left word-list sections. Highest values in upper, lowest in lower.
    tooltip_columns: List[str]
    tooltip_column_names: Dict[str, str]
    term_description_columns: List[str]
    term_description_column_names: Dict[str]
    term_word_in_term_description: str, default None
    color_column: str, default None:
        column in term_metadata_df which indicates color
    color_score_column: str, default None
        column in term_metadata df; contains value between 0 and 1 which will be used to assign a color
    label_priority_column : str, default None
        Column in term_metadata_df; larger values in the column indicate a term should be labeled first
    censor_point_column : str, default None
        Should we allow labels to be drawn over point?
    right_order_column : str, default None
        Order for right column ("characteristic" by default); largest first
    background_color : str, default None
        Changes document.body's background color to background_color
    line_coordinates : list, default None
        Coordinates for drawing a line under the plot
    subword_encoding : str, default None
        Type of subword encoding to use, None if none, currently supports "RoBERTa"
    top_terms_length : int, default 14
        Number of words to list in most/least associated lists on left-hand side
    top_terms_left_buffer : int, default 0
        Number of pixels left to shift top terms list
    dont_filter : bool, default False
        Don't filter any terms when charting
    get_column_header_html : str, default None
        Javascript function to return html over each column. Matches header
        (Column Name, occurrences per 25k, occs, # occs * 1000/num docs, term info)
    show_term_etc: bool, default True
        Shows list of etc values after clicking term
    use_offsets : bool, default False
        Enable the use of metadata offsets
    sort_contexts_by_meta : bool, default False
        Sort context by meta instead of match strength
    suppress_circles : bool, default False
        Label terms over circles and hide circless
    show_chart : bool, default False
        Show line chart if unified context is true
    return_data : bool default False
        Return a dict containing the output of `ScatterChartExplosrer.to_dict` instead of
        an html.
    category_colors : dict, optional defaut None
        Dictionary matching category names to colors
    document_word : str, default "document"
    document_word_plural : Optional[str], default "document"
    category_order : Optional[list[str]], default None
        Order of categories in line chart
    include_gradient : bool, False
        Include gradient at the top of the chart
    left_gradient_term : Optional[str], None by default
        Text of left gradient label. category_name by default
    middle_gradient_term : Optional[str], None by default
        Text of middle grad label. If None, not shown.
    right_gradient_term: Optional[str], None by default
        Text of right gradient label, not_category_name by default
    gradient_text_color: str, white by default
        Color of text in gradient
    gradient_colors: Optional[List[str]], None by default, follows d3_color_scale
        Colors of gradient, as a list of hex values (e.g, ['#0000ff', '#fe0100', '#00ff00'])
    category_term_scores: Optional[List[List[float]], None by default
        score[category, term] for table visualization
    category_term_score_scaler: Optional[str], None by default
        Javascript function which scales a set of categories scores to between 0 and 1
    return_scatterplot_structure : bool, default False
        return ScatterplotStructure instead of html

    Returns
    -------
    str
    html of visualization

    
scattertext/__init__.py