def _add_term_freq_to_json_df(self, json_df, term_freq_df, category) -> pd.DataFrame:
        '''
        json_df['cat25k'] = (((term_freq_df[category + ' freq'] * 1.
                               / term_freq_df[category + ' freq'].sum()) * 25000).fillna(0)
                             .apply(np.round).astype(int))
        json_df['ncat25k'] = (((term_freq_df['not cat freq'] * 1.
                                / term_freq_df['not cat freq'].sum()) * 25000).fillna(0)
                              .apply(np.round).astype(int))
        '''
        json_df = json_df.assign(
            cat25k=(((term_freq_df[str(category) + ' freq'] * 1.
                      / term_freq_df[str(category) + ' freq'].sum()) * 25000).fillna(0)
                    .apply(np.round).astype(int)),
            ncat25k=(((term_freq_df['not cat freq'] * 1.
                       / term_freq_df['not cat freq'].sum()) * 25000).fillna(0)
                     .apply(np.round).astype(int)),
            neut25k=0,
            neut=0,
            extra25k=0,
            extra=0
        )

        if 'neut cat freq' in term_freq_df:
            json_df = json_df.assign(
                neut25k=(((term_freq_df['neut cat freq'] * 1.
                           / term_freq_df['neut cat freq'].sum()) * 25000).fillna(0)
                         .apply(np.round).astype(int)),
                neut=term_freq_df['neut cat freq']
            )

        if 'extra cat freq' in term_freq_df:
            json_df = json_df.assign(
                extra25k=(((term_freq_df['extra cat freq'] * 1.
                            / term_freq_df['extra cat freq'].sum()) * 25000).fillna(0)
                          .apply(np.round).astype(int)),
                extra=term_freq_df['extra cat freq']
            )
        return json_df

        json_df['cat25k'] = (((term_freq_df[category + ' freq'] * 1.
                               / term_freq_df[category + ' freq'].sum()) * 25000).fillna(0)
                             .apply(np.round).astype(int))
        json_df['ncat25k'] = (((term_freq_df['not cat freq'] * 1.
                                / term_freq_df['not cat freq'].sum()) * 25000).fillna(0)
                              .apply(np.round).astype(int))
        
scattertext/ScatterChart.py