Skip to content

Instantly share code, notes, and snippets.

Avatar

Ismael Ghalimi ghalimi

View GitHub Profile
View secondaries.json
[
{ "dimensions": ["incremental"], "measures": ["differential"], "visual": "tape" },
{ "dimensions": ["nominal"], "measures": ["differential"], "visual": "train" },
{ "dimensions": ["incremental"], "measures": ["quantizable"], "visual": "castle" },
{ "dimensions": ["nominal"], "measures": ["quantizable"], "visual": "dot" },
{ "dimensions": ["incremental", "nominal"], "measures": ["quantizable"], "visual": "stair" },
{ "dimensions": ["nominal", "nominal"], "measures": ["quantizable"], "visual": "scale" },
{ "dimensions": ["incremental"], "measures": ["cardinal"], "visual": "castle" },
{ "dimensions": ["nominal"], "measures": ["cardinal"], "visual": "dot" },
{ "dimensions": ["incremental", "incremental"], "measures": ["cardinal"], "visual": "contour" },
View aliases.json
{
"bonbon": {
"visual": "table",
"axes": ["columns", "rows", "color", "symbol"]
},
"chocolate": {
"visual": "table",
"axes": ["columns", "rows", "symbol"]
},
"gradient": {
View options.json
{
"visual" : [
{
"id" : "overview",
"name" : "Overview",
"options" : [
{
"id" : "title",
"name" : "Title",
"datatype" : "string"
@ghalimi
ghalimi / BIN2HEX.js
Last active Dec 10, 2015
BIN2HEX Function
View BIN2HEX.js
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function BIN2HEX(number, places) {
// Return error if number is not binary or contains more than 10 characters (10 digits)
if (!/^[01]{1,10}$/.test(number)) return '#NUM!';
// Ignore places and return a 10-character hexadecimal number if number is negative
var stringified = number.toString();
if (stringified.length === 10 && stringified.substring(0, 1) === '1') {
return (1099511627264 + parseInt(stringified.substring(1), 2)).toString(16);
@ghalimi
ghalimi / BIN2DEC.js
Last active Dec 10, 2015
BIN2DEC Function
View BIN2DEC.js
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function BIN2DEC(number) {
// Return error if number is not binary or contains more than 10 characters (10 digits)
if (!/^[01]{1,10}$/.test(number)) return '#NUM!';
// Convert binary number to decimal
var result = parseInt(number, 2);
// Handle negative numbers
@ghalimi
ghalimi / BIN2OCT.js
Last active Dec 10, 2015
BIN2OCT Function
View BIN2OCT.js
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function BIN2OCT(number, places) {
// Return error if number is not binary or contains more than 10 characters (10 digits)
if (!/^[01]{1,10}$/.test(number)) return '#NUM!';
// Ignore places and return a 10-character octal number if number is negative
var stringified = number.toString();
if (stringified.length === 10 && stringified.substring(0, 1) === '1') {
return (1073741312 + parseInt(stringified.substring(1), 2)).toString(8);
@ghalimi
ghalimi / BITAND.js
Created Jan 8, 2013
BITAND Function
View BITAND.js
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function BITAND(number1, number2) {
// Return error if either number is a non-numeric value
if (isNaN(number1) || isNaN(number2)) return '#VALUE!';
// Return error if either number is less than 0
if (number1 < 0 || number2 < 0) return '#NUM!';
// Return error if either number is a non-integer
@ghalimi
ghalimi / BITXOR.js
Created Jan 8, 2013
BITXOR Function
View BITXOR.js
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function BITXOR(number1, number2) {
// Return error if either number is a non-numeric value
if (isNaN(number1) || isNaN(number2)) return '#VALUE!';
// Return error if either number is less than 0
if (number1 < 0 || number2 < 0) return '#NUM!';
// Return error if either number is a non-integer
@ghalimi
ghalimi / BITOR.js
Created Jan 8, 2013
BITOR Function
View BITOR.js
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function BITOR(number1, number2) {
// Return error if either number is a non-numeric value
if (isNaN(number1) || isNaN(number2)) return '#VALUE!';
// Return error if either number is less than 0
if (number1 < 0 || number2 < 0) return '#NUM!';
// Return error if either number is a non-integer
@ghalimi
ghalimi / BITLSHIFT.js
Last active Dec 10, 2015
BITLSHIFT Function
View BITLSHIFT.js
// Copyright (c) 2012 Sutoiku, Inc. (MIT License)
function BITLSHIFT(number, shift) {
// Return error if either number is a non-numeric value
if (isNaN(number) || isNaN(shift)) return '#VALUE!';
// Return error if number is less than 0
if (number < 0) return '#NUM!';
// Return error if number is a non-integer