This file contains hidden or 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
# Deletes documents returned from a view named 'badones' in a design document named 'logging' | |
# The view must emit doc._id as the key. Here's an example design document | |
# function (doc) { | |
# var badword = 'mistake'; | |
# if (doc.anotherprop && doc.anotherprop.substr(0, badword.length) === badword) { | |
# emit(doc._id, doc.anotherprop); | |
# } | |
# } | |
import requests |
This file contains hidden or 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
var request = require('superagent'); | |
// Replace these 3 variables with your own information | |
// Note: The database must be world readable | |
const CLOUDANT_ACCOUNT = 'opendata'; | |
const CLOUDANT_DB = 'pois'; | |
const GEO_INDEX = '_design/idx/_geo/spatial'; | |
for (var index = 0; index < 500; index++) { | |
runQuery(index) |
This file contains hidden or 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(isDefault=True) | |
class TableDisplayMeta(DisplayHandlerMeta): | |
@addId | |
def getMenuInfo(self,entity, dataHandler): | |
if dataFrameMisc.isPySparkDataFrame(entity) or dataFrameMisc.isPandasDataFrame(entity): | |
return [ | |
{"categoryId": "Table", "title": "DataFrame Table", "icon": "fa-table", "id": "dataframe"} | |
] | |
elif dataFrameMisc.fqName(entity) == "graphframes.graphframe.GraphFrame": | |
return [ |
This file contains hidden or 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
class TableDisplay(Display): | |
def doRender(self, handlerId): | |
entity=self.entity | |
if dataFrameMisc.fqName(entity) == "graphframes.graphframe.GraphFrame": | |
if handlerId == "edges": | |
entity=entity.edges | |
else: | |
entity=entity.vertices | |
if dataFrameMisc.isPySparkDataFrame(entity) or dataFrameMisc.isPandasDataFrame(entity): | |
self._addHTMLTemplate('dataframeTable.html', entity=PandasDataFrameAdapter(entity)) |
This file contains hidden or 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
<style type="text/css" class="pd_save"> | |
.df-table-wrapper .panel-heading { | |
border-radius: 0; | |
padding: 0px; | |
} | |
.df-table-wrapper .panel-heading:hover { | |
border-color: #008571; | |
} | |
.df-table-wrapper .panel-title a { | |
background-color: #f9f9fb; |
This file contains hidden or 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 .SimpleDisplay import SimpleDisplay | |
from ..display import * | |
import pixiedust.utils.dataFrameMisc as dataFrameMisc | |
@PixiedustDisplay() | |
class SimpleDisplayMeta(DisplayHandlerMeta): | |
@addId | |
def getMenuInfo(self,entity,dataHandler): | |
if dataFrameMisc.isPySparkDataFrame(entity) or dataFrameMisc.isPandasDataFrame(entity): | |
return [ |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.32.1/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.32.1/mapbox-gl.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |
This file contains hidden or 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
------------------------------------------------------------------------ | |
Copyright IBM Corp. 2017 | |
Licensed under the Apache License, Version 2.0 (the 'License'); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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
{ | |
"type": "Feature", | |
"geometry": { | |
"type": "LineString", | |
"coordinates": [ | |
[-81.54453, 28.37968], | |
[-81.54517, 28.37869], | |
[-81.54594, 28.37742], | |
[-81.54615, 28.37686], | |
[-81.54635, 28.37677], |