def __addFSCPTraces(plotData: pd.DataFrame, plotLines: pd.DataFrame, n_lines: int, refFuel: str, config: dict, sensitivityNG: bool=False):
    traces = []
    for index in range(n_lines):
        thisDataScatter = plotData.query(f'plotIndex=={index}').reset_index(drop=True)
        thisDataLine = plotLines.query(f'plotIndex=={index}').reset_index(drop=True)
        truncated = (((thisDataScatter.loc[(0, 'fuel_x')] == 'blue LEB') and (thisDataScatter.loc[(0, 'fuel_y')] == 'green RE')) or (thisDataScatter.loc[(0, 'fuel_x')] == 'blue LEB lowscco2'))
        dashed = (thisDataScatter.loc[(0, 'fuel_y')] in ['green pure RE', 'blue LEB lowscco2'])
        longdashed = (thisDataScatter.loc[(0, 'fuel_x')] == 'blue LEB lowscco2')
        shift = 0
        if (thisDataScatter.loc[(0, 'fuel_y')] == 'green RE'):
            if (thisDataScatter.loc[(0, 'fuel_x')] == 'ref'):
                shift = (- 1)
            else:
                shift = (+ 1)
        elif (thisDataScatter.loc[(0, 'fuel_y')] == 'green pure RE'):
            shift = (+ 2)
            thisDataScatter = thisDataScatter.query(f'year<=2035')
            thisDataLine = thisDataLine.query(f'year<=2035')
        fuel_x = thisDataScatter.iloc[thisDataScatter.first_valid_index()]['fuel_x']
        fuel_y = thisDataScatter.iloc[0]['fuel_y']
        name = (f"Fossil→{config['names'][fuel_y]}" if (fuel_x == 'ref') else f"{config['names'][fuel_x]}→{config['names'][fuel_y]}")
        col = (config['fscp_colours'][f'{fuel_x} to {fuel_y}'] if (f'{fuel_x} to {fuel_y}' in config['fscp_colours']) else config['colours'][fuel_y])
        if (sensitivityNG and (fuel_x == 'blue LEB')):
            continue
        traces.append((index, go.Scatter(x=thisDataScatter['year'], y=thisDataScatter['fscp'], name=name, legendgroup=(0 if (fuel_x == 'ref') else 1), showlegend=False, mode='markers', line=dict(color=col, width=config['global']['lw_default'], dash=('dot' if dashed else 'solid')), marker=dict(symbol='x-thin', size=config['global']['highlight_marker_sm'], line={'width': config['global']['lw_thin'], 'color': col}), hovertemplate=f'<b>{name}</b><br>Year: %{{x:d}}<br>FSCP: %{{y:.2f}}&plusmn;%{{error_y.array:.2f}}<extra></extra>')))
        if (truncated and (not sensitivityNG)):
            thisDataLine = thisDataLine.query(f'(year>=2030 & fscp>0.0) | year>=2040')
        traces.append((index, go.Scatter(x=thisDataLine['year'], y=thisDataLine['fscp'], legendgroup=(0 if (fuel_x == 'ref') else 1), legendgrouptitle=dict(text=(f"<b>{config['legendlabels'][0]}:</b>" if (fuel_x == 'ref') else f"<b>{config['legendlabels'][0]}:</b>")), name=name, mode='lines', line=dict(color=col, width=config['global']['lw_default'], dash=('dot' if dashed else ('dash' if longdashed else 'solid'))))))
        thisDataScatter = thisDataScatter.query(f'year==[2030,2040,2050]')
        thisDataScatter = thisDataScatter.query(f"fscp<={config['plotting']['fscp_max']} and (fscp>0.0 | year > 2040)")
        traces.append((index, go.Scatter(x=(thisDataScatter['year'] + (shift * 0.1)), y=thisDataScatter['fscp'], error_y=dict(type='data', array=thisDataScatter['fscp_uu'], arrayminus=thisDataScatter['fscp_ul'], thickness=config['global']['lw_thin']), name=name, legendgroup=(0 if (fuel_x == 'ref') else 1), showlegend=False, mode='markers', marker=dict(symbol='x-thin', size=1e-05), line_color='rgba({}, {}, {}, {})'.format(*hex_to_rgb(col), 0.4), hovertemplate=f'<b>{name}</b><br>Year: %{{x:d}}<br>FSCP: %{{y:.2f}}&plusmn;%{{error_y.array:.2f}}<extra></extra>')))
    return traces
def __addFSCPTraces(plotData: pd.DataFrame, plotLines: pd.DataFrame, n_lines: int, refFuel: str, config: dict, sensitivityNG: bool=False):
    traces = []
    for index in range(n_lines):
        thisDataScatter = plotData.query(f'plotIndex=={index}').reset_index(drop=True)
        thisDataLine = plotLines.query(f'plotIndex=={index}').reset_index(drop=True)
        truncated = (((thisDataScatter.loc[(0, 'fuel_x')] == 'blue LEB') and (thisDataScatter.loc[(0, 'fuel_y')] == 'green RE')) or (thisDataScatter.loc[(0, 'fuel_x')] == 'blue LEB lowscco2'))
        dashed = (thisDataScatter.loc[(0, 'fuel_y')] in ['green pure RE', 'blue LEB lowscco2'])
        longdashed = (thisDataScatter.loc[(0, 'fuel_x')] == 'blue LEB lowscco2')
        shift = 0
        if (thisDataScatter.loc[(0, 'fuel_y')] == 'green RE'):
            if (thisDataScatter.loc[(0, 'fuel_x')] == 'ref'):
                shift = (- 1)
            else:
                shift = (+ 1)
        elif (thisDataScatter.loc[(0, 'fuel_y')] == 'green pure RE'):
            shift = (+ 2)
            thisDataScatter = thisDataScatter.query(f'year<=2035')
            thisDataLine = thisDataLine.query(f'year<=2035')
        fuel_x = thisDataScatter.iloc[thisDataScatter.first_valid_index()]['fuel_x']
        fuel_y = thisDataScatter.iloc[0]['fuel_y']
        name = (f"Fossil→{config['names'][fuel_y]}" if (fuel_x == 'ref') else f"{config['names'][fuel_x]}→{config['names'][fuel_y]}")
        col = (config['fscp_colours'][f'{fuel_x} to {fuel_y}'] if (f'{fuel_x} to {fuel_y}' in config['fscp_colours']) else config['colours'][fuel_y])
        if (sensitivityNG and (fuel_x == 'blue LEB')):
            continue
        traces.append((index, go.Scatter(x=thisDataScatter['year'], y=thisDataScatter['fscp'], name=name, legendgroup=(0 if (fuel_x == 'ref') else 1), showlegend=False, mode='markers', line=dict(color=col, width=config['global']['lw_default'], dash=('dot' if dashed else 'solid')), marker=dict(symbol='x-thin', size=config['global']['highlight_marker_sm'], line={'width': config['global']['lw_thin'], 'color': col}), hovertemplate=f'<b>{name}</b><br>Year: %{{x:d}}<br>FSCP: %{{y:.2f}}&plusmn;%{{error_y.array:.2f}}<extra></extra>')))
        if (truncated and (not sensitivityNG)):
            thisDataLine = thisDataLine.query(f'(year>=2030 & fscp>0.0) | year>=2040')
        traces.append((index, go.Scatter(x=thisDataLine['year'], y=thisDataLine['fscp'], legendgroup=(0 if (fuel_x == 'ref') else 1), legendgrouptitle=dict(text=(f"<b>{config['legendlabels'][0]}:</b>" if (fuel_x == 'ref') else f"<b>{config['legendlabels'][0]}:</b>")), name=name, mode='lines', line=dict(color=col, width=config['global']['lw_default'], dash=('dot' if dashed else ('dash' if longdashed else 'solid'))))))
        thisDataScatter = thisDataScatter.query(f'year==[2030,2040,2050]')
        thisDataScatter = thisDataScatter.query(f"fscp<={config['plotting']['fscp_max']} and (fscp>0.0 | year > 2040)")
        traces.append((index, go.Scatter(x=(thisDataScatter['year'] + (shift * 0.1)), y=thisDataScatter['fscp'], error_y=dict(type='data', array=thisDataScatter['fscp_uu'], arrayminus=thisDataScatter['fscp_ul'], thickness=config['global']['lw_thin']), name=name, legendgroup=(0 if (fuel_x == 'ref') else 1), showlegend=False, mode='markers', marker=dict(symbol='x-thin', size=1e-05), line_color='rgba({}, {}, {}, {})'.format(*hex_to_rgb(col), 0.4), hovertemplate=f'<b>{name}</b><br>Year: %{{x:d}}<br>FSCP: %{{y:.2f}}&plusmn;%{{error_y.array:.2f}}<extra></extra>')))
    return traces