Skip to content

Instantly share code, notes, and snippets.

@vnegi10
Created January 27, 2024 16:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vnegi10/294e5fbe5de5e816bd4a8f31d69a7198 to your computer and use it in GitHub Desktop.
Save vnegi10/294e5fbe5de5e816bd4a8f31d69a7198 to your computer and use it in GitHub Desktop.
from pages.floor_price.view import app
from dash.dependencies import Input, Output
from pages.floor_price.model import plot_nft_hist, plot_nft_markets, send_email
@app.callback(
Output(component_id = 'plot', component_property = 'figure'),
Input(component_id = 'MODE', component_property= 'value'),
Input(component_id = 'NFT_ID', component_property= 'value'),
Input(component_id = 'DURATION', component_property= 'value'),
Input(component_id = 'WINDOW_SIZE', component_property= 'value'),
Input(component_id = 'ORDER_BY', component_property= 'value'),
Input(component_id = 'NUM_ENTRIES', component_property= 'value'),
)
def graph_update(mode, nft_id, duration, window_size, order_by, num_entries):
if mode == "market_data":
return plot_nft_markets(order_by, int(num_entries))
elif mode == "hist_floor_price":
return plot_nft_hist(nft_id, int(duration), int(window_size))
else:
return send_email(nft_id, int(duration), int(window_size))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment