Skip to content

Instantly share code, notes, and snippets.

define([
"require",
"cdf/AddIn",
"cdf/Dashboard.Clean"
], function(require, AddIn, Dashboard) {
"use strict";
var custom = {
name: "customMarker",
label: "A custom Marker addIn",
@carlosrusso
carlosrusso / preExecution.js
Last active June 29, 2017 14:20
Map Component addIn that uses a marker defined in the resultset
function(){
this.markerImageGetter = "urlMarker2";
this.setAddInOptions("MarkerImage", "urlMarker2", {
iconUrlColIdx: 4 // column where the marker urls are
});
}
@carlosrusso
carlosrusso / inlineGeoJSON.js
Last active June 22, 2017 13:32
inlineGeoJSON
define([
"cdf/AddIn",
"cdf/Dashboard.Clean",
"cdf/lib/jquery",
"amd!cdf/lib/underscore"
], function(AddIn, Dashboard, $, _) {
"use strict";
var inlineGeoJSON = {
@carlosrusso
carlosrusso / geocode
Created May 10, 2017 13:13
LocationResolver that uses "data science toolkit"
/*!
* Copyright 2017 Pentaho Corporation. All rights reserved.
*
* 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
@carlosrusso
carlosrusso / model.js
Created August 5, 2016 16:39
Notes on visual roles
/*!
* Copyright 2010 - 2016 Pentaho Corporation. All rights reserved.
*
* 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
@carlosrusso
carlosrusso / postFetch.js
Created July 27, 2015 18:41
Filter component: automatically select the first element of a query
function(json){
var selectedItems = [ json.resultset[0][0] ];
this.dashboard.setParameter(this.parameter, selectedItems)
return json;
}