Skip to content

Instantly share code, notes, and snippets.

View xhluca's full-sized avatar
💭
🔨

Xing Han Lu xhluca

💭
🔨
View GitHub Profile
@xhluca
xhluca / usage-elements-collapse.py
Created April 5, 2019 19:29
Experiments of collapsing nodes - not implemented yet
import json
import dash
from dash.dependencies import Input, Output, State
import dash_core_components as dcc
import dash_html_components as html
import dash_cytoscape as cyto
from demos import dash_reusable_components as drc
@xhluca
xhluca / python_currying.py
Created April 3, 2019 02:18
Pseudo-currying in Python
from inspect import signature
def curry(function):
def helper(args, remain_count):
if remain_count == 0:
return function(*args)
def mid_func(arg):
return helper(args + [arg], remain_count - 1)
@xhluca
xhluca / selenium_dash.py
Last active March 1, 2019 22:04
Example of interacting with dash apps and saving screenshot - uses https://github.com/plotly/dash-cytoscape/blob/master/usage-advanced.py
import os
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
driver = webdriver.Chrome()
import requests
import dash
import dash_html_components as html
import dash_cytoscape as cyto
app = dash.Dash(__name__)
# Request the data from the sample network
url = 'https://raw.githubusercontent.com/plotly/dash-cytoscape/master/demos/data/sample_network.txt'
@xhluca
xhluca / concentric-network.py
Last active January 31, 2019 02:23
Displaying over 8000 edges and their associated nodes with a concentric layout. This uses the Stanford Google+ Dataset
import requests
import dash
import dash_html_components as html
import dash_cytoscape as cyto
app = dash.Dash(__name__)
# Request the data from the sample network
url = 'https://raw.githubusercontent.com/plotly/dash-cytoscape/master/demos/data/sample_network.txt'
import os
# Replace with the name of your Dash app
# This will end up being part of the URL of your deployed app,
# so it can't contain any spaces, capitalizations, or special characters
#
# This name MUST match the name that you specified in the
# Dash App Manager
DASH_APP_NAME = 'dash-app-name'

App Name

This is a demo of the Dash interactive Python framework developed by Plotly.

Dash abstracts away all of the technologies and protocols required to build an interactive web-based application and is a simple and effective way to bind a user interface around your Python code. To learn more check out our documentation.

Try out the [demo app here](link to the demo app).

animated1

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.