From af9a9ff274c33abfe5d330e0d3e907f0fb39d903 Mon Sep 17 00:00:00 2001 From: vanislekahuna Date: Thu, 18 Aug 2022 12:41:06 -0700 Subject: [PATCH] Issue #32: Added tooltips for important terms (forked) --- src/apps/tco2_dashboard/c3t.py | 33 +++++++++++++++- src/apps/tco2_dashboard/mco2.py | 21 +++++++++- .../tco2_dashboard/offchain_vs_onchain.py | 39 +++++++++++++++++-- src/apps/tco2_dashboard/tco2.py | 16 +++++++- 4 files changed, 101 insertions(+), 8 deletions(-) diff --git a/src/apps/tco2_dashboard/c3t.py b/src/apps/tco2_dashboard/c3t.py index 218a2a9..45a055a 100644 --- a/src/apps/tco2_dashboard/c3t.py +++ b/src/apps/tco2_dashboard/c3t.py @@ -10,7 +10,22 @@ def create_content_c3t(df, df_retired, fig_pool_pie_chart): dbc.Col( dbc.Card([ dbc.CardHeader( - html.H1("State of C3 Tokenized Carbon", className='page-title')) + html.H1(["State of", + html.Span( + html.A( + "C3 Tokenized Carbon", + href='https://docs.klimadao.finance/references/glossary#c3-token', + ), + id="tooltip-target", + style={"textDecoration": "underline", "cursor": "pointer"} + )], className='page-title'), + + dbc.Tooltip("A utility token for the C3 carbon bridge. \ + It is distributed as a reward to users of the protocol that stake, bridge or provide liquidity.", + target="tooltip-target", + style={"text-align": "right"},), + + ) ]), width=12, style={'textAlign': 'center'}) ), @@ -62,7 +77,21 @@ def create_content_c3t(df, df_retired, fig_pool_pie_chart): dbc.Col(), dbc.Col([ dbc.Card([ - dbc.CardHeader(html.H2("Deep Dive into C3T")), + dbc.CardHeader( + html.H2(["Deep Dive into", + html.Span( + html.A( + "C3T", + href='https://docs.klimadao.finance/references/glossary#c3t', + ), + id="tooltip-target", + style={"textDecoration": "underline", "cursor": "pointer"} + ) + ]), + dbc.Tooltip("C3 Tonne (C3T) is the general term for fungible tokenized carbon offsets bridged via C3.", + target="tooltip-target", + style={"text-align": "right"},), + ), dbc.CardBody([ dbc.Row([ dbc.Col([ diff --git a/src/apps/tco2_dashboard/mco2.py b/src/apps/tco2_dashboard/mco2.py index 33b8cfc..3690387 100644 --- a/src/apps/tco2_dashboard/mco2.py +++ b/src/apps/tco2_dashboard/mco2.py @@ -50,8 +50,25 @@ def table_type(df_column): dbc.Row([ dbc.Col(), dbc.Col(dbc.Card([ - dbc.CardBody(html.H2('Deep Dive into Bridged MCO2'), - style={'textAlign': 'center'}) + dbc.CardBody(html.H2(['Deep Dive into Bridged', + html.Span( + html.A( + "MCO2", + href='https://docs.klimadao.finance/references/glossary#mco2', + ), + id="tooltip-target", + style={"textDecoration": "underline", "cursor": "pointer"} + ),]), + + dbc.Tooltip( + "\ + Moss Carbon Credit (MCO2) is a relatively homogenenous, centrally managed pool of tokenized Verra VCUs. \ + Moss created it in August 2020, by curating REDD+ projects in the Amazon Rainforest (one in Peru, five in Brazil).\ + ", + target="tooltip-target", + style={"text-align": "right"},), + + style={'textAlign': 'center'},) ]), lg=6, md=12), dbc.Col(), ], style={'paddingTop': '60px'}), diff --git a/src/apps/tco2_dashboard/offchain_vs_onchain.py b/src/apps/tco2_dashboard/offchain_vs_onchain.py index a0f423d..8e0a7e9 100644 --- a/src/apps/tco2_dashboard/offchain_vs_onchain.py +++ b/src/apps/tco2_dashboard/offchain_vs_onchain.py @@ -11,7 +11,21 @@ def create_offchain_vs_onchain_content(bridges_info_dict, retires_info_dict, df_ dbc.Col( dbc.Card([ dbc.CardHeader( - html.H1("State of Tokenized Carbon")), + html.H1(["State of", + html.Span( + html.A( + "Tokenized Carbon", + href='https://docs.klimadao.finance/references/glossary#tokenized-carbon-asset', + ), + id="tooltip-target", + style={"textDecoration": "underline", "cursor": "pointer"}) + ]), + + dbc.Tooltip("\ + A Tokenized Carbon Asset (TCA) refers to a carbon asset (e.g. voluntary carbon offset) brought onto the blockchain. \ + ", + target="tooltip-target", + style={"text-align": "right"})), dbc.CardFooter( verra_fallback_note, id="fallback_indicator") @@ -22,8 +36,27 @@ def create_offchain_vs_onchain_content(bridges_info_dict, retires_info_dict, df_ dbc.Col( dbc.Card([ dbc.CardHeader( - html.H1("State of Tokenized Carbon")), - ]), width=12, style={'textAlign': 'center'}), + html.H1([ + "State of", + html.Span( + html.A( + "Tokenized Carbon", + href='https://docs.klimadao.finance/references/glossary#tokenized-carbon-asset', + ), + id="tooltip-target", + style={"textDecoration": "underline", "cursor": "pointer"}) + ]), + + dbc.Tooltip("A Tokenized Carbon Asset (TCA) refers to a carbon asset (e.g. voluntary carbon offset) brought onto the blockchain.", + target="tooltip-target", + style={"text-align": "right"} + ), + + width=12, style={'textAlign': 'center'} + ), + ]), + + ), ) sum_total_tokenized = sum(d['Dataframe']['Quantity'].sum() diff --git a/src/apps/tco2_dashboard/tco2.py b/src/apps/tco2_dashboard/tco2.py index 861578a..106ba53 100644 --- a/src/apps/tco2_dashboard/tco2.py +++ b/src/apps/tco2_dashboard/tco2.py @@ -62,7 +62,21 @@ def create_content_toucan(df, df_retired, fig_pool_pie_chart): dbc.Col(), dbc.Col([ dbc.Card([ - dbc.CardHeader(html.H2("Deep Dive into TCO2")), + dbc.CardHeader(html.H2([ + "Deep Dive into", + html.Span( + html.A("TCO2", + href='https://docs.klimadao.finance/references/glossary#tco2'), + id="tooltip-target", + style={"textDecoration": "underline", "cursor": "pointer"} + ) + ]), + + dbc.Tooltip("Toucan Carbon Tokens (TCO2) is the general term for fungible tokenized carbon offsets bridged via Toucan", + target="tooltip-target", + style={"text-align": "right"},) + + ), dbc.CardBody([ dbc.Row([ dbc.Col([