Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shortcut to set values to the chart column #4

Open
kozo2 opened this issue Nov 4, 2014 · 0 comments
Open

shortcut to set values to the chart column #4

kozo2 opened this issue Nov 4, 2014 · 0 comments
Assignees

Comments

@kozo2
Copy link
Member

kozo2 commented Nov 4, 2014

I'll add a function for this type of snippet.

chart_entry = 'barchart: attributelist="ld20t14,ld20t16,ld20t20,ld20t24,ld20t28,ld20t32,ld20t36,ld20t40,ld20t44,ld20t48,ld20t52,ld20t56,ld20t60,ld20t64,ld20t68,ld20t72" colorlist="up:red,zero:red,down:red" showlabels="false"'

target_row_url = BASE_URL + "networks/" + str(pathway_suid) + "/tables/defaultnode/columns/KEGG"
res2 = requests.get(target_row_url)
matched = json.loads(res2.content)["values"]

df2 = pd.DataFrame(columns=["id", "chart"]);
df2["id"] = matched
df2["chart"] = chart_entry

data = json.loads(df2.to_json(orient="records"))

chart_data = {
    "key": "KEGG",
    "dataKey": "id",
    "data": data
}

requests.put(update_table_url, data=json.dumps(chart_data), headers=HEADERS)
@kozo2 kozo2 changed the title shortcut for table import shortcut to set values to the chart column Dec 26, 2014
@jorgeboucas jorgeboucas self-assigned this May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants