Comments (2)
Thanks Andrea!
Apologies, I haven't had a chance to update that doc yet. I've been trying to move to something more shiny-like that doesn't require all the boilerplate of starting a flask app.
The examples are all much more streamlined now. I wrote a gist
to cover some of the changes. Originally I was using PyReact to transpile the jsx code into javascript at runtime. Then PyReact was deprecated, so I introduced some wrappers for webpack and npm to build a javascript bundle. I felt like this was a big pain and a huge barrier to entry, so I've been thinking about how to rework it. What I settled on was including the basic components to get an app running.
If you look in the plotly example under project/__init__.py
this is what you will see. I've included a simple index.html in the latest version and a javascript bundle. The locations are provided in the default_static_path
and default_template_path
functions. There's a file in the directory called buildui.py
that does the normal pyxley stuff of creating a UILayout
. Instead of writing a bunch of templated javascript file, the app just sends the props as JSON.
from os import path
from buildui import get_layouts
from pyxley.utils import create_app, default_static_path, default_template_path
# create the flask app
here = path.abspath(path.dirname(__file__))
app = create_app(here, default_static_path(), default_template_path())
# build the layout
get_layouts(app, here+"/fitbit_data.csv")
if __name__ == "__main__":
app.run(debug=True)
If you want to do something more custom and build your own javascript bundle, I suggest looking at the tests
folder. I've made an app that renders all of the widgets in different tabs.
I'll try to get to updating the documentation soon. Sorry for the confusion!
from pyxley.
Hi,
thanks a lot for the reply. I can fully agree on the "big pain" argument :)
The example you mention looks indeed a lot better, and it runs without problems.
from pyxley.
Related Issues (20)
- Error: Module not found: Error: Cannot resolve module 'react-dom' HOT 2
- Does it need a server or is everything running on the client side? HOT 2
- bower.json missing from datatables example
- Error instaling node-sass when using pyxapp --init . (ubuntu 14.04) HOT 1
- how can i refresh the data periodically? HOT 1
- Add LICENSE to MANIFEST.in HOT 1
- pyxley in production HOT 1
- Error with webpack HOT 1
- pyxley's example can't run successful!!!
- Example Wrong!!!! HOT 3
- requirements.txt HOT 2
- Line Plot not plotting properly HOT 7
- Passing the url parameters from layout to the components HOT 2
- Adding Google map integration
- Unable to arrange plots side by side.
- updating the underlying data does not change the plots and charts on the web page HOT 4
- getting pyxley to work HOT 1
- Loading pyxley charts and datatable from jquery
- Proposing a PR to fix a few small typos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyxley.