This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name chango | |
// @namespace vabarbosa.simple-data-vis | |
// @description add simple data visualizations to cloudant.com and couchdb views | |
// @match *://*.cloudant.com/dashboard.html* | |
// @include /^http://127.0.0.1:5984/_utils/#/database/.*/_design/.*/_view/.*$/ | |
// @require https://d3js.org/d3.v4.min.js | |
// @require https://raw.githubusercontent.com/vabarbosa/simple-data-vis/master/simpledatavis.js | |
// @require https://raw.githubusercontent.com/vabarbosa/simple-data-vis/master/vis/simpledatavis-barchart.js | |
// @require https://raw.githubusercontent.com/vabarbosa/simple-data-vis/master/vis/simpledatavis-bubblechart.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"endpoint": "/", | |
"method": "GET", | |
"database": ["Cloudant", "CouchDB 1.6", "CouchDB 2.0"], | |
"summary": "Meta information about the cluster.", | |
"comment": "", | |
"links": ["https://docs.cloudant.com/advanced.html#get-/", "http://docs.couchdb.org/en/1.6.0/api/server/common.html#", "http://docs.couchdb.org/en/2.0.0/api/server/common.html#"] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "spark.cloudant", | |
"iconUri": "//ibm-watson-data-lab.github.io/pixiedust_learning/codegen/icons/cloudant_tile.png", | |
"title": "Spark Cloudant connector", | |
"subtopics": [ | |
{ | |
"id": "cloudant.load", | |
"iconUri": "//ibm-watson-data-lab.github.io/pixiedust_learning/codegen/icons/cloudant_tile.png", | |
"title": "Load a dataframe from Cloudant", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pixiedust.display.display import * | |
class TestDisplay(Display): | |
def doRender(self, handlerId): | |
self._addHTMLTemplateString( | |
""" | |
<div>My Simple Table</div> | |
<table class="table table-striped"> | |
<thead> | |
{%for field in entity.schema.fields%} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PixiedustDisplay() | |
class TestPluginMeta(DisplayHandlerMeta): | |
@addId | |
def getMenuInfo(self,entity,dataHandler): | |
if entity.__class__.__name__ == "DataFrame": | |
return [ | |
{ | |
"categoryId": "Table", | |
"title": "My Simple Table", | |
"icon": "fa-table", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pixiedust.display.display import * | |
from wordcloud import WordCloud | |
import cStringIO | |
import base64 | |
class SimpleWordCloudDisplay(Display): | |
def doRender(self, handlerId): | |
# convert from dataframe to dict | |
dfdict = {} | |
df = self.entity.toPandas() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@PixiedustDisplay() | |
class SimpleWordCloudMeta(DisplayHandlerMeta): | |
@addId | |
def getMenuInfo(self,entity,dataHandler): | |
if entity.__class__.__name__ == "DataFrame": | |
return [ | |
{ | |
"categoryId": "Chart", | |
"title": "Simple Word Cloud", | |
"icon": "fa-cloud", |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer