Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
rousan committed Sep 14, 2018
2 parents 662a33b + d61a92e commit 632a26b
Show file tree
Hide file tree
Showing 66 changed files with 892 additions and 544 deletions.
2 changes: 1 addition & 1 deletion dist/muze.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/muze.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/muze.js.map

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions examples/data/cars-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[
{
"name": "Name",
"type": "dimension"
},
{
"name": "Maker",
"type": "dimension"
},
{
"name": "Miles_per_Gallon",
"type": "measure",
"defAggFn": "max"
},
{
"name": "Displacement",
"type": "measure",
"defAggFn": "max"
},
{
"name": "Horsepower",
"type": "measure",
"defAggFn": "avg"
},
{
"name": "Weight_in_lbs",
"type": "measure",
"defAggFn": "min"
},
{
"name": "Acceleration",
"type": "measure",
"defAggFn": "avg"
},
{
"name": "Origin",
"type": "dimension"
},
{
"name": "Cylinders",
"type": "dimension"
},
{
"name": "Year",
"type": "dimension",
"subtype": "temporal",
"format": "%Y-%m-%d"
}
]
16 changes: 12 additions & 4 deletions examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.min.js"></script>
</head>
<style>
body, html{
font-family: 'Source Sans Pro',"Helvetica Neue",Helvetica,Arial,sans-serif;
/* width:300px;
height: 100%; */
/* overflow: scroll; */
display: flex;
align-items: center;
justify-content: center;
/*margin: 50px;*/
Expand Down Expand Up @@ -48,16 +48,25 @@
}
#chart {
float: left;
width: 200px;
/* height: 210px; */
/* overflow: auto; */
/* border: 1px solid black; */
}
#parentdiv {
display: inline-block;

}
.info-box {
display: flex;
flex-direction: column;
padding: 5px 0px 5px 0px;
}
.muze-layer-point {
fill-opacity: 1 !important;
stroke-opacity: 1 !important;
/* fill: #086bb6; */
/* stroke: #086bb6; */
}
.info-section {
display: flex;
align-items: center;
Expand All @@ -80,16 +89,15 @@
<div id="chart2"></div>
</div>

<div class="chart"></div>

<script src="./js/d3.js"></script>
<script src="./muze.js"></script>
<script src="js/datamodel.js"></script>
<script src="js/temp-paths.js"></script>
<script src="./js/regression.min.js"></script>
<script src="./js/sample.js"></script>
<!-- <script src="./js/design-sample.js"></script> -->
</body>
<link rel='stylesheet' href="./muze.css">
<style>
.referenceZone rect {
fill: #fff1f1;
Expand Down
134 changes: 56 additions & 78 deletions examples/js/sample.js
Original file line number Diff line number Diff line change
@@ -1,71 +1,66 @@
/* eslint-disable */

(function () {
let env = muze();
let DataModel = muze.DataModel;
const DataModel = muze.DataModel;

d3.json('../data/cars.json', (data) => {
const jsonData = data,
schema = [
{
name: 'Name',
type: 'dimension'
},
{
name: 'Maker',
type: 'dimension'
},
{
name: 'Miles_per_Gallon',
type: 'measure'
},
{
name: 'Name',
type: 'dimension'
},
{
name: 'Maker',
type: 'dimension'
},
{
name: 'Miles_per_Gallon',
type: 'measure'
},

{
name: 'Displacement',
type: 'measure'
},
{
name: 'Horsepower',
type: 'measure'
},
{
name: 'Weight_in_lbs',
type: 'measure',
},
{
name: 'Acceleration',
type: 'measure',
defAggFn: 'avg'
},
{
name: 'Origin',
type: 'dimension'
},
{
name: 'Cylinders',
type: 'dimension'
},
{
name: 'Year',
type: 'dimension',
// subtype: 'temporal',
// format: '%Y-%m-%d'
}
];
let rootData = new DataModel(jsonData, schema);
{
name: 'Displacement',
type: 'measure'
},
{
name: 'Horsepower',
type: 'measure',
defAggFn: 'avg'
},
{
name: 'Weight_in_lbs',
type: 'measure'
},
{
name: 'Acceleration',
type: 'measure',
defAggFn: 'sum'
},
{
name: 'Origin',
type: 'dimension'
},
{
name: 'Cylinders',
type: 'dimension'
},
{
name: 'Year',
type: 'dimension'
// subtype: 'temporal',
// format: '%Y-%m-%d'
}
];
const rootData = new DataModel(jsonData, schema);

// rootData = rootData.groupBy(['Year'], {
// Horsepower: 'mean',
// Acceleration: 'mean'
// });

env = env.data(rootData).minUnitHeight(40).minUnitWidth(40);
let mountPoint = document.getElementById('chart');
window.canvas = env.canvas();
let rows = ['Acceleration'],
columns = ['Displacement'];
// rootData = rootData.groupBy(['Maker']);
// rootData = rootData.sort([['Acceleration', 'ASC']]);
const mountPoint = document.getElementById('chart');
let canvas = env.canvas();
canvas = canvas
.rows(rows)
.columns(columns)
Expand All @@ -77,28 +72,11 @@
field: 'Horsepower'
})
.layers([{
mark: 'point'
mark: 'bar'
}])
.config({
groupBy: {
disabled: true
},
border: {
width: 2,
},
axes: {
x: {
showAxisName: true,
axisNamePadding: 20,
}, y: {
showAxisName: true,
axisNamePadding: 20,
}
}
})
.title('The Muze Project', { position: "top", align: "left", })
.subtitle('Composable visualisations with a data first approach', { position: "top", align: "left" })
.mount(document.getElementsByTagName('body')[0]);
})

})()
.height(300)
.title('The Muze Project', { position: 'top', align: 'left' })
.subtitle('Composable visualisations with a data first approach', { position: 'top', align: 'left' })
.mount(document.getElementById('chart'));
});
}());
Loading

0 comments on commit 632a26b

Please sign in to comment.