Skip to content

Commit

Permalink
first pass polymerizing
Browse files Browse the repository at this point in the history
  • Loading branch information
stevewirts committed Nov 13, 2014
0 parents commit 516878d
Show file tree
Hide file tree
Showing 30 changed files with 3,463 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"directory" : "../"
}
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true


[*]

# Change these settings to your own preference
indent_style = space
indent_size = 4

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/build
/deploy
/bower_components
src/scripts/templates.js
node_modules
21 changes: 21 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 4,
"latedef": true,
"newcap": true,
"noarg": true,
"quotmark": "single",
"regexp": true,
"undef": true,
"unused": true,
"strict": true,
"trailing": true,
"smarttabs": true
}
114 changes: 114 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
'use strict';

var files = {
js: [
'gruntfile.js',
'js/**/*.js',
'test/**/*.js'
],

jshint: [
'gruntfile.js',
'js/**/*.js',
'test/**/*.js',
],

};

module.exports = function(grunt) {

//load all npm tasks automagically
require('load-grunt-tasks')(grunt);

grunt.initConfig({

watch: {
js: {
files: files.js,
tasks: ['jsbeautifier', 'jshint', 'mochaTest'],
},
gruntfile: {
files: ['Gruntfile.js'],
tasks: []
},
lr: {
files: ['**/*.html', 'src/scripts/*.js'],
options: {
livereload: true
},
tasks: ['jshint']
}
},

jshint: {
files: files.jshint,
options: {
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
}
},

mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['test/*.js']
}
},

jsbeautifier: {
files: files.js,
options: {
js: {
braceStyle: 'collapse',
breakChainedMethods: false,
e4x: false,
evalCode: false,
indentChar: ' ',
indentLevel: 0,
indentSize: 4,
indentWithTabs: false,
jslintHappy: false,
keepArrayIndentation: false,
keepFunctionIndentation: false,
maxPreserveNewlines: 10,
preserveNewlines: true,
spaceBeforeConditional: true,
spaceInParen: false,
unescapeStrings: false,
wrapLineLength: 0
}
}
},

connect: {
server: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0',
base: ['.', '../'],
livereload: true,
open: true
}
}
},

//----------------------------------
});

grunt.registerTask('test', ['jshint', 'mochaTest']);
grunt.registerTask('default', [
'jsbeautifier',
'jshint',
'mochaTest',
]);

grunt.registerTask('serve', function() {
return grunt.task.run([
'connect',
'watch'
]);
});
};
25 changes: 25 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
The OpenFin License

Copyright (c) 2014 OpenFin Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

You may not redistribute the software or modifications as part of any
application that can be described as a development toolkit, library or
framework.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fin-rectangle
================

See the [component page](http://stevewirts.github.io/stevewirts/fin-rectangle) for more information.

## Getting Started

We've put together a [guide for fin-rectangle](http://www.polymer-project.org/docs/start/reusableelements.html) to help get you rolling.
65 changes: 65 additions & 0 deletions bigtable.q
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// this example script spoofs a 100MM row table using a vector of shorts that index into
// a 255 row table, sorting is not supported in this example as it will blow up
// the 32 bit free version of Q

$[.z.K<3.19999;0N! "You need version 3.2 or later for this, please download a more recent version of q";]
\p 5000

features:flip (
(`sorting; 0b);
(`foo; 0b)
);
features:features[0]!features[1];

0N! "generate random row ordering";
numRows:100000000;

holdingId:`abcde`bcdef`cdefgh`defgh`efghi`fghij`ghijk;
symbol:`msft`amat`csco`intc`yhoo`aapl;
trader:`mustafa`reidel`wynn`armatas`markovitz`bierly`tulchinsky;
sector:`energy`materials`industrials`financials`healthcare`utilities`infotech;
strategy:`statarb`pairs`mergerarb`house`chart`indexarb

n:255;
trade:([]
tradeId:til n;
holdingId:n ? holdingId;
symbol:n ? symbol;
sector:n ? sector;
trader:n ? trader;
strategy:n ? strategy;
time:09:30:00.0+n?23000000;
price:50 + .23 * n ? 400;
quantity:(100 * 10 + n ? 20) - 2000;
date:2000.01.01 + asc n ? 365;
price1:50 + .23 * n ? 400;
amount1:n ? 1.0;
price2:50 + .23 * n ? 400;
amount2:(20*til n)_((n*20)?100);
date2:2000.01.01 + asc n ? 365;
price3:50 + .23 * n ? 400;
amount3:(20*til n)_((n*20)?100);
date3:2000.01.01 + asc n ? 365;
price4:50 + .23 * n ? 400;
amount4:100 * 10 + n ? 20;
date4:2000.01.01 + asc n ? 365;
amount5:100 * 10 + n ? 20);


\t rowsIndexes:numRows?`short$til 255;

window:{[start;num]
ii: start + til num;
([]row:ii),'trade[rowsIndexes[ii]]}

.z.ws:{
message: .j.c x;
@[`$message`cmd;message`data];
}

fetch: {
json: .j.j (`data`rows`headers`features)!(value each window[`long$(x`start);`long$(x`num)];numRows;(enlist (`row;"j")),(value each select c,t from meta trade);features);
neg[.z.w] json; //negating a handle makes the sending of data async
}


19 changes: 19 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "fin-hypergrid",
"version": "0.2.1",
"keywords": [
"seed",
"polymer",
"web-components"
],
"main": "fin-hypergrid.html",
"dependencies": {
"polymer": "Polymer/polymer#^0.4.0",
"fin-canvas": "~0.0.3",
"fin-rectangle": "~0.2.2",
"shadow-bar": "~0.12.0"
},
"devDependencies": {
"polymer-test-tools": "Polymer/polymer-test-tools#^0.4.0"
}
}
15 changes: 15 additions & 0 deletions demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>fin-hypergrid Demo</title>

<script src="../platform/platform.js"></script>
<link rel="import" href="fin-hypergrid.html">
</head>
<body unresolved>

<fin-hypergrid></fin-hypergrid>

</body>
</html>
3 changes: 3 additions & 0 deletions fin-hypergrid.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
:host {

}
15 changes: 15 additions & 0 deletions fin-hypergrid.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../fin-canvas/fin-canvas.html">
<script src="js/constants.js"></script>
<script src="js/DefaultCellProvider.js"></script>
<script src="js/PluggableGridBehaviors/DefaultGridBehavior.js"></script>
<script src="js/PluggableGridBehaviors/InMemoryGridBehavior.js"></script>
<script src="js/PluggableGridBehaviors/QGridBehavior.js"></script>
<script src="js/DefaultSelectionModel.js"></script>
<script src="js/HypergridRenderer.js"></script>
<script src="js/Hypergrid.js"></script>
<polymer-element name="fin-hypergrid">
<template>
</template>
<script src="fin-hypergrid.js"></script>
</polymer-element>
13 changes: 13 additions & 0 deletions fin-hypergrid.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

(function() {
var root = this;
Polymer('fin-hypergrid', { /* jshint ignore:line */
ready: function() {
root.fin.wc.hypergrid.Hypergrid(this);
//this.setBehavior(new root.fin.wc.hypergrid.DefaultGridBehavior());
this.setBehavior(new root.fin.wc.hypergrid.InMemoryGridBehavior());
//this.setBehavior(new root.fin.wc.hypergrid.QGridBehavior('ws://' + location.hostname + ':5000/'));
}
});
}).call(this);
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<script src="../platform/platform.js"></script>
<link rel="import" href="../polymer/polymer.html">
<link rel="import" href="../core-component-page/core-component-page.html">

</head>
<body unresolved>
<core-component-page></core-component-page>
</body>
</html>
12 changes: 12 additions & 0 deletions js/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"esnext": false,
"moz": true,
"boss": true,
"node": true,
"validthis": true,
"globals": {
"EventEmitter": true,
"Promise": true
},
"strict": true
}
Loading

0 comments on commit 516878d

Please sign in to comment.