Skip to content

Commit

Permalink
Merge pull request #53 from nponarul/charts
Browse files Browse the repository at this point in the history
chore: merge charts into dev
  • Loading branch information
alxndrkalinin committed Jan 22, 2016
2 parents 31c504f + 9bc4cb9 commit b749875
Show file tree
Hide file tree
Showing 7 changed files with 617 additions and 363 deletions.
14 changes: 10 additions & 4 deletions app/app.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ App.config([
templateUrl: 'partials/analysis/tools/machineLearning/kMeans/sidebar.html'
)
.state('charts'
url: '/charts/:projectId/:forkId'
url: '/charts'
views:
'main':
templateUrl: 'partials/analysis/charts/main.html'
Expand All @@ -143,7 +143,8 @@ App.run([
'app_analysis_charts_constructor'
#'app.utils.importer'
# ($rootScope, core, db, getData, wrangleData, qualRobEst, qualRobEstView, instrPerfEval) ->
($rootScope, core, db, getData, wrangleData, instrPerfEval, kMeans) ->
($rootScope, core, db, getData, wrangleData, instrPerfEval, kMeans, charts) ->


map = [
# msgFrom: 'add numbers'
Expand Down Expand Up @@ -203,14 +204,15 @@ App.run([
scopeTo: ['wrangleData']
,
msgFrom: 'get table'
scopeFrom: ['chartsView']
scopeFrom: ['charts']
msgTo: 'get table'
scopeTo: ['database']
,
msgFrom: 'take table'
scopeFrom: ['database']
msgTo: 'take table'
scopeTo: ['chartsView']
scopeTo: ['charts']

]

core.setEventsMapping map
Expand All @@ -236,8 +238,12 @@ App.run([
core.register 'kMeans', kMeans
core.start 'kMeans'

core.register 'charts', charts
core.start 'charts'
#core.register 'importer', importer
#core.start 'importer'
core.register 'charts', charts
core.start 'charts'

# add module to the list of Tools to appear in Tools tab dropdown
tools = [
Expand Down
17 changes: 5 additions & 12 deletions app/partials/analysis/charts/main.jade
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
div(ng-controller='chartsMainCtrl')
h2 Charts
div(ng-switch='currentPlot')
div(ng-switch-when='none')
span.alert Please choose variables and plot type.

nvd3-line-chart#exampleId(ng-switch-when='line',data='data', width='{{width}}', height='{{height}}', showxaxis='true', showyaxis='true')
svg

nvd3-cumulative-line-chart#showXAxisExample(ng-switch-when='cumulativeLine',data='data', width='550', height='350', showxaxis='false', showyaxis='true', x='xFunction()', y='yFunction()', xaxistickformat='xAxisTickFormatFunction()', margin='{left:50,top:50,bottom:50,right:50}')
svg

div.container-fluid(ng-controller="mainChartsCtrl")
h4 {{chartData.name}}
div.row-fluid
d3-charts
scatter-plot
34 changes: 17 additions & 17 deletions app/partials/analysis/charts/sidebar.jade
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
div(ng-controller="chartsSidebarCtrl")
form
fieldset
legend Project
label fork 
input(ng-model="currentFork",disabled = true).input-small
legend Plots
label Choose one 
select(ng-model="currentPlot")
option(ng-repeat='p in plots') {{p.label}}
legend Variables
label X 
select(ng-model="xVariable")
option(ng-repeat="v in variables") {{v}}
label Y 
select(ng-model="yVariable")
option(ng-repeat="v in variables") {{v}}
div(ng-controller="sideChartsCtrl")
h4 Graphs
select.form-control#chooseGraph(value="Choose a graph" ng-change="changeName()" ng-model="graphSelect" ng-options="g as g.name for g in graphs")
h4 Variables
div.form-inline
div.form-horizontal
label(for = "x") Add X
select#x.form-control(ng-change="changeVar(selector1,headers,'x');" ng-model="selector1" ng-options="v as v.value for v in headers")
div.form-horizontal
label(for = "y") Add Y
select#y.form-control(ng-change="changeVar(selector2,headers,'y');" ng-model="selector2" ng-options="v as v.value for v in headers")
div.form-horizontal
label(for = "z") Add Z
select#z.form-control(ng-change="changeVar(selector3,headers,'z');" ng-model="selector3" ng-options="v as v.value for v in headers")

//add variable options.
button.btn.btn-default(ng-click="createGraph()") Graph
8 changes: 8 additions & 0 deletions app/partials/analysis/charts/tab-head.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@


//Top of graph tabs
li
a(data-toggle ='tab' href= "{{name}}") {{name}}
//Created by nponarul on 11/22/15.
Loading

0 comments on commit b749875

Please sign in to comment.