Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
encrypted-fox committed Jan 17, 2020
1 parent 1d0880b commit aced094
Show file tree
Hide file tree
Showing 56 changed files with 8,415 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
Binary file added cities/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added cities/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added cities/__pycache__/api.cpython-38.pyc
Binary file not shown.
Binary file added cities/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added cities/__pycache__/serializers.cpython-38.pyc
Binary file not shown.
Binary file added cities/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added cities/__pycache__/views.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added countries/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added countries/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added countries/__pycache__/api.cpython-38.pyc
Binary file not shown.
Binary file added countries/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added countries/__pycache__/serializers.cpython-38.pyc
Binary file not shown.
Binary file added countries/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file added frontend/__init__.py
Empty file.
Binary file added frontend/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added frontend/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added frontend/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added frontend/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added frontend/__pycache__/views.cpython-38.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions frontend/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.contrib import admin

# Register your models here.
5 changes: 5 additions & 0 deletions frontend/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class FrontendConfig(AppConfig):
name = 'frontend'
Empty file added frontend/migrations/__init__.py
Empty file.
Binary file not shown.
3 changes: 3 additions & 0 deletions frontend/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.db import models

# Create your models here.
911 changes: 911 additions & 0 deletions frontend/src/components/canvasjs.min.js

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions frontend/src/components/canvasjs.react.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
var React = require('react');
export var CanvasJS = require('./canvasjs.min');
CanvasJS = CanvasJS.Chart ? CanvasJS : window.CanvasJS;

export class CanvasJSChart extends React.Component {
static _cjsContainerId = 0
constructor(props) {
super(props);
this.options = props.options ? props.options : {};
this.containerProps = props.containerProps ? props.containerProps : {width: "100%", position: "relative"};
this.containerProps.height = props.containerProps && props.containerProps.height ? props.containerProps.height : this.options.height ? this.options.height + "px" : "400px";
this.chartContainerId = "canvasjs-react-chart-container-" + CanvasJSChart._cjsContainerId++;
}
componentDidMount() {
//Create Chart and Render
this.chart = new CanvasJS.Chart(this.chartContainerId, this.options);
this.chart.render();

if(this.props.onRef)
this.props.onRef(this.chart);
}
shouldComponentUpdate(nextProps, nextState){
//Check if Chart-options has changed and determine if component has to be updated
return !(nextProps.options === this.options);
}
componentDidUpdate() {
//Update Chart Options & Render
this.chart.options = this.props.options;
this.chart.render();
}
componentWillUnmount() {
//Destroy chart and remove reference
this.chart.destroy();
if(this.props.onRef)
this.props.onRef(undefined);
}
render() {
//return React.createElement('div', { id: this.chartContainerId, style: this.containerProps });
return <div id = {this.chartContainerId} style = {this.containerProps}/>
}
}

export var CanvasJSReact = {
CanvasJSChart: CanvasJSChart,
CanvasJS: CanvasJS
};

export default CanvasJSReact;
922 changes: 922 additions & 0 deletions frontend/src/components/jquery.canvasjs.min.js

Large diffs are not rendered by default.

602 changes: 602 additions & 0 deletions frontend/static/frontend/main.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions frontend/tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from django.test import TestCase

# Create your tests here.
5 changes: 5 additions & 0 deletions frontend/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.shortcuts import render


def index(request):
return render(request, 'frontend/index.html')
Binary file added languages/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added languages/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added languages/__pycache__/api.cpython-38.pyc
Binary file not shown.
Binary file added languages/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file added languages/__pycache__/serializers.cpython-38.pyc
Binary file not shown.
Binary file added languages/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file added logging_database/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file added logging_database/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file added logging_database/__pycache__/api.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file added logging_database/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file added logging_database/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit aced094

Please sign in to comment.