Skip to content

Instantly share code, notes, and snippets.

@vabarbosa
vabarbosa / chango.user.js
Last active May 1, 2021 13:40
add simple data visualizations to Cloudant and CouchDB views
// ==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
@vabarbosa
vabarbosa / cloudant-couchdb-api.json
Last active December 5, 2016 18:17
Cloudant & CouchDB API Reference
[
{
"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#"]
},
@vabarbosa
vabarbosa / codegen-pixiedust.json
Last active June 28, 2017 05:20
PixieDust codegen
[
{
"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",
@vabarbosa
vabarbosa / pd-simpletable-template.py
Last active April 17, 2017 20:44
PixieDust Extensibility API - Simple Table Template
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%}
@vabarbosa
vabarbosa / pd-simpletable-metadata.py
Last active April 18, 2017 22:26
PixieDust Extensibility API - Simple Table Metadata
@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",
@vabarbosa
vabarbosa / pd-wordcloud-template.py
Last active April 28, 2017 17:22
PixieDust Extensibility API - Word Cloud Template
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()
@vabarbosa
vabarbosa / pd-wordcloud-metadata.py
Last active April 17, 2017 20:48
PixieDust Extensibility API - Word Cloud Metadata
@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",
@vabarbosa
vabarbosa / notebooks with pixiedust - 1.ipynb
Last active June 28, 2017 05:22
intro to notebooks with pixiedust - part 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vabarbosa
vabarbosa / notebooks with pixiedust - 2.ipynb
Last active June 28, 2017 05:22
intro to notebooks with pixiedust - part 2
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.