stitchfix / pyxley Goto Github PK
View Code? Open in Web Editor NEWPython helpers for building dashboards using Flask and React
License: MIT License
Python helpers for building dashboards using Flask and React
License: MIT License
Hi,
I just started using pyxley to create some dashboards and we are currently facing a little issue:
This pyxley dashboards are part of a bigger flask application and lies on a blueprint, that part is fine after some minor problems.
The big problem comes when we want to render the same dashboard with the data updates, because that means we need to restart the application every time this happens, otherwise we will be overwriting the same flask endpoint for the react components.
Somebody have any thoughts on that particular problem? We can create infinite endpoints with increasing numbers, but obviously that is not the right approach :)
Thanks,
Yeray
Hi, I'm VERY new to python but have fallen in love w/ pandas. As such I'm trying to use pyxley for some of my projects. Quick question....when I run the datatables example, and set up bower, I get an error b/c the example doesn't have a bower file. If I borrow bower.json from another folder, when I run the app.py, I get an import error, " cannot import name 'jsx'"
What am I doing wrong?
Hello,
I jsonify is not define in scatter_plot.py, line 46
return self.view_functions[rule.endpoint](**req.view_args)
File "build/bdist.linux-x86_64/egg/pyxley/charts/mg/scatter_plot.py", line 46, in get_data
return jsonify(ScatterPlot.to_json(
NameError: global name 'jsonify' is not defined
Many BUG happens!!!
Hi all,
I'm working through the examples, running python 2.7 (it seems python 3.4 doesn't work).
However I just get this - and a blank page.
Would y'all consider adding an explicit MANIFEST that includes the license? This would help with including hard links to license data in conda
builds
Hey - first of all thanks for kicking this off!
I'm actually playing with it, and I wonder if there is an option to hide a column in data table. I know you can using the visible option https://datatables.net/reference/option/columns.visible but I can't get to make it work with pyxley.
I know this isn't the best place to post request for support, but I haven't found any where else to go!
Thanks!
Thank you for pyxley, I need help in adding the google map to the dashboard ! Help me please with resources or code.
Using a fresh clone of pyxley
today in Python 2.7 (using a freshly-updated Anaconda Python 2.7 environment) I see a problem with setup.py
:
pyxley $ python setup.py install
.../lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
...
<rest of setup completes successfully>
This leads to the following pyreact
error:
pyxley/examples/datamaps/project $ python app.py
Traceback (most recent call last):
File "app.py", line 10, in <module>
from pyxley import UILayout
.../lib/python2.7/site-packages/pyxley/__init__.py", line 1, in <module>
import ui
.../lib/python2.7/site-packages/pyxley/ui.py", line 1, in <module>
from react_template import ReactComponent
File .../lib/python2.7/site-packages/pyxley/react_template.py", line 1, in <module>
from react import jsx
ImportError: No module named react
Swapping line 1 of setup.py
from distutils
to setuptools
solves the issue:
#from distutils.core import setup
from setuptools import setup
and after a fresh install with python setup.py install
the demo runs.
My knowledge of Python packaging is a bit patchy but I'm pretty sure setuptools
is the normal way (nowadays, after all the other "normal ways" we've had along the way):
https://docs.python.org/3/library/distutils.html
"Most Python users will not want to use this module directly, but instead use the cross-version tools maintained by the Python Packaging Authority. In particular, setuptools is an enhanced alternative to distutils that provides:
...
The recommended pip installer runs all setup.py scripts with setuptools, even if the script itself only imports distutils. Refer to the Python Packaging User Guide for more information."
For reference these are my versions:
In [2]: distutils.__version__
Out[2]: '2.7.10'
In [4]: setuptools.__version__
Out[4]: '17.1.1'
This explains+fixes the manual install in my other bug report #5
Hello, thanks for the library. This might be the tool that helps me stop showing other data scientists how to write new Flask(+swagger) apps from a template.
I'm a Python 3.4 developer (I'll also note #4), I can't get pyxley running. Firstly - maybe you could mark in the README that only Python 2.7 is supported at present?
I tried running 2to3 --write pyxley/
after a git-clone and it said it succeeded (so all the files might now be Python 3.4 compatible). I then ran python setup.py install
which also succeeded. Oddly I had to run pip install pyreact
by hand, I'm not sure if there's a problem with the conversion process.
I started to follow the guide here http://multithreaded.stitchfix.com/blog/2015/07/16/pyxley/ but the first imports fail (from pyxley.utils import FilterFrame
- no .utils
?). I then tried running the included examples
but had errors due to the 2to3
conversion and str
datatypes e.g.
pyxley/examples/datamaps/project $ python app.py
Traceback (most recent call last):
File "app.py", line 55, in <module>
sb = ui.render_layout(app, "./static/layout.js")
File "/home/ian/anaconda/envs/scratch/lib/python3.4/site-packages/pyxley/ui.py", line 90, in render_layout
static_path=path)
File "/home/ian/anaconda/envs/scratch/lib/python3.4/site-packages/pyxley/react_template.py", line 64, in __init__
self.to_js()
File "/home/ian/anaconda/envs/scratch/lib/python3.4/site-packages/pyxley/react_template.py", line 25, in to_js
self.write_to_file(js)
File "/home/ian/anaconda/envs/scratch/lib/python3.4/site-packages/pyxley/react_template.py", line 17, in write_to_file
f.write(s)
TypeError: 'str' does not support the buffer interface
The above error occurs for datamaps
, metricsgraphics
, datatables
.
I'll try using Python 2.7 at some point.
Hi,
I would like to use Pyxley with AdminLTE - see here: https://almsaeedstudio.com/AdminLTE
Looking at the Facebook React documentation: https://facebook.github.io/react/docs/tutorial.html
It seems that the only way to do this is to create one big React component for the project, which in turn returns all the constituent components (for graphs, tables, etc. )
Is this the best way to go about this? (I have no prior experience with React, only with Shiny)
Hi I get the following errors.
Traceback (most recent call last):
File "app.py", line 13, in
from pyxley.charts.datatables import DataTable
File "/Users/peadarcoyle/anaconda/lib/python3.4/site-packages/pyxley/init.py", line 1, in
import ui
ImportError: No module named 'ui'
Any suggestions on why this might be?
Hi,
first of all, thanks for providing this code.
I am new to pyxley, and I was trying to run the basic app described in docs/basic.rst.
Btw, it would be really great if the instructions could be made idiot proof, for example by explicitely saying that index.html must be manually created and filled with the simple div, and that one needs to manually "bower install pyxley". At least , I did that, I hope it's not wrong :)
Once this is done, I still cannot run the example, with npm complaining that a package.json is not found in my top folder (what is called "App" in the dcumentation).
I also noticed that my top folder has no bower.json file, and it should be there according to the documentation (although it is unclear how it gets there)
Am I missing anything?
Kind regards,
Andrea.
Hi there. Trying to play with this (thanks for sharing), I've hit in the following dead end:
pyxley/examples/datatables$ bower --version
1.4.1
pyxley/examples/datatables$ git diff .
pyxley/examples/datatables$ bower install
bower require#* not-cached git://github.com/nathanfaucett/require.js.git#*
bower require#* resolve git://github.com/nathanfaucett/require.js.git#*
bower bootstrap#~3.3.4 cached git://github.com/twbs/bootstrap.git#3.3.5
bower bootstrap#~3.3.4 validate 3.3.5 against git://github.com/twbs/bootstrap.git#~3.3.4
bower classnames#~2.1.1 cached git://github.com/JedWatson/classnames.git#2.1.3
bower classnames#~2.1.1 validate 2.1.3 against git://github.com/JedWatson/classnames.git#~2.1.1
bower d3#~3.5.5 cached git://github.com/mbostock/d3.git#3.5.6
bower d3#~3.5.5 validate 3.5.6 against git://github.com/mbostock/d3.git#~3.5.5
bower react#~0.13.1 cached git://github.com/facebook/react-bower.git#0.13.3
bower react#~0.13.1 validate 0.13.3 against git://github.com/facebook/react-bower.git#~0.13.1
bower nvd3#~1.7.1 cached git://github.com/novus/nvd3.git#1.7.1
bower nvd3#~1.7.1 validate 1.7.1 against git://github.com/novus/nvd3.git#~1.7.1
bower react-bootstrap#~0.22.6 cached git://github.com/react-bootstrap/react-bootstrap-bower.git#0.22.6
bower react-bootstrap#~0.22.6 validate 0.22.6 against git://github.com/react-bootstrap/react-bootstrap-bower.git#~0.22.6
bower jquery#~2.1.3 cached git://github.com/jquery/jquery.git#2.1.4
bower jquery#~2.1.3 validate 2.1.4 against git://github.com/jquery/jquery.git#~2.1.3
bower datatables#~1.10.6 cached git://github.com/DataTables/DataTables.git#1.10.7
bower datatables#~1.10.6 validate 1.10.7 against git://github.com/DataTables/DataTables.git#~1.10.6
bower datamaps#~0.4.0 cached git://github.com/markmarkoh/datamaps.git#0.4.0
bower datamaps#~0.4.0 validate 0.4.0 against git://github.com/markmarkoh/datamaps.git#~0.4.0
bower metrics-graphics#~2.5.0 cached git://github.com/mozilla/metrics-graphics.git#2.5.0
bower metrics-graphics#~2.5.0 validate 2.5.0 against git://github.com/mozilla/metrics-graphics.git#~2.5.0
bower pyxley#~0.0.1 cached git://github.com/stitchfix/pyxleyJS.git#0.0.2
bower pyxley#~0.0.1 validate 0.0.2 against git://github.com/stitchfix/pyxleyJS.git#~0.0.1
bower require#* checkout master
bower d3#~3.3.13 cached git://github.com/mbostock/d3.git#3.3.13
bower d3#~3.3.13 validate 3.3.13 against git://github.com/mbostock/d3.git#~3.3.13
bower topojson#~1.4.3 cached git://github.com/mbostock/topojson.git#1.4.9
bower topojson#~1.4.3 validate 1.4.9 against git://github.com/mbostock/topojson.git#~1.4.3
bower require#* invalid-meta require is missing "main" entry in bower.json
bower require#* invalid-meta require is missing "ignore" entry in bower.json
bower require#* resolved git://github.com/nathanfaucett/require.js.git#a45d433fdc
bower ECONFLICT Unable to find suitable version for d3
pyxley/examples/datatables$ json_pp < .bowerrc
{
"directory" : "./project/static/bower_components"
}
Any hints?
Thanks a lot
Stephan
PyReact is not being maintained anymore and should be removed as a dependency.
Proposed Solution:
Remove jsx transformation step (instead write the jsx file)
Create a build step (relying on babel or webpack)
Create a pipeline to determine whether or not to include buildstep
Hi,
When I try to run the examples, it gives me an error with something called 'webpack'...
"""
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run-script" "build"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: webpack
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'webpack'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the PyxleyApp package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs PyxleyApp
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls PyxleyApp
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\marcelo\Desktop\pyxley-master\examples\metricsgraphics\project\npm-debug.log
Failed to run npm run-script build
: Command '['npm', 'run-script', 'build']' returned non-zero exit status 1
Please resolve javascript errors
"""
Can you help me please?
Thank you,
Luis
requirements.txt
Flask
pandas
pyxley
I was wondering, if there is any way how to pass the parameters from the layout to the components. Let’s say I have a layout with table and some charts and I would like to directly include the filtering in the parameters of this layout. For example http://localhost/my_layout?data=something resulting in passing these to all the components, serving like a filter.
Many thanks,
Martin
sb = ui.render_layout(app, "./static/layout.js")
I can't find ./static/layout.js,the file always make the error.What should be done to make it.
$pwd
/Users/peder/source/pyxley/examples/datatables
$ bower install
bower ENOENT No bower.json present
Did you forget to commit a bower.json file?
Great project, thanks for the effort. Will fork and attempt to assist.
python app.py
[email protected] build /home/yujingmin/pyxley-master/examples/custom_react
webpack
Hash: 829dbf17cef235e992a5
Version: webpack 1.14.0
Time: 3006ms
Asset Size Chunks Chunk Names
bundle.js 2.49 MB 0 [emitted] main
[0] multi main 40 bytes {0} [built]
+ 460 hidden modules
ERROR in ./project/static/jsx/custom.js
Module not found: Error: Cannot resolve module 'pyxley' in /home/yujingmin/pyxley-master/examples/custom_react/project/static/jsx
@ ./project/static/jsx/custom.js 16:14-31
[email protected] build /home/yujingmin/pyxley-master/examples/custom_react
webpack
Hash: 65f4d854c69451f4a3f7
Version: webpack 1.14.0
Time: 2888ms
Asset Size Chunks Chunk Names
bundle.js 2.49 MB 0 [emitted] main
[0] multi main 40 bytes {0} [built]
+ 460 hidden modules
ERROR in ./project/static/jsx/custom.js
Module not found: Error: Cannot resolve module 'pyxley' in /home/yujingmin/pyxley-master/examples/custom_react/project/static/jsx
@ ./project/static/jsx/custom.js 16:14-31
Hi,
just started testing pyxley a little -
And when trying to install the package json i get -
npm WARN package.json [email protected] No repository field.
@nmkridler
Thanks
I am facing the above error while trying out a histogram with the following code.
hc = Histogram(df, hFig, "depth", 20)
ui.add_chart(hc)
hello,
i try to use pyxley in a production environment but i found that when i change the underlying data the plots and charts in the web page don't get affected with these data changes.
i follow all the instructions in this url:
http://pyxley.readthedocs.io/en/latest/production.html
but it doesn't solve the problem.
this is the code for the metrics graphics example after i modified it as mentioned in the above link
def create_line_plot(df):
""" create a mg line plot
Args:
df (pandas.DataFrame): data to plot
"""
fig = Figure("/mg/line_plot/", "mg_line_plot")
fig.graphics.transition_on_update(True)
fig.graphics.animate_on_load()
fig.layout.set_size(width=450, height=200)
fig.layout.set_margin(left=40, right=40)
myData = MyDataWrapper(df, "Date", ["value"])
lc = LineChart(df, fig, "Date", ["value"], route_func=myData.my_route_function,timeseries=True)
return lc
print ("after rtuuuuuurn")
#return LineChart(df, fig, "Date", ["value"],init_params={"Data": "Steps"}, timeseries=True)
def create_histogram(df):
""" create a mg line plot
Args:
df (pandas.DataFrame): data to plot
"""
fig = Figure("/mg/histogram/", "mg_histogram")
fig.layout.set_size(width=450, height=200)
fig.layout.set_margin(left=40, right=40)
fig.graphics.animate_on_load()
# Make a histogram with 20 bins
return Histogram(df, fig, "value", 20, init_params={"Data": "Steps"})
def create_scatterplot(df):
""" create a mg line plot
Args:
df (pandas.DataFrame): data to plot
"""
fig = Figure("/mg/scatter/", "mg_scatter")
fig.layout.set_size(width=450, height=200)
fig.layout.set_margin(left=40, right=40)
fig.graphics.animate_on_load()
init_params = {"Data": "Steps"}
def get_data():
y = request.args.get("Data", "Steps")
return jsonify(ScatterPlot.to_json(df, "Steps", y))
# Make a histogram with 20 bins
return ScatterPlot(df, fig, "Steps", "Distance",
init_params={}, route_func=get_data)
def make_mg_layout(filename):
# load a dataframe
df = pd.read_csv(filename)
#global lc
# Make a UI
ui = UILayout("FilterChart")
# Make a Button
cols = [c for c in df.columns if c != "Date"]
btn = SelectButton("Data", cols, "Data", "Steps")
# add the button to the UI
ui.add_filter(btn)
# stack the dataframe
_stack = df.set_index("Date").stack().reset_index()
_stack = _stack.rename(columns={"level_1": "Data", 0: "value"})
# Make a Figure, add some settings, make a line plot
ui.add_chart(create_line_plot(_stack))
ui.add_chart(create_histogram(_stack))
ui.add_chart(create_scatterplot(df))
return ui
def get_layouts(mod, filename):
# metrics graphics
print ('hiiiiiiiiiiiiii')
print ('wiiiiiiiiii')
mg_ui = make_mg_layout(filename)
mg_ui.assign_routes(mod)
mg_props = mg_ui.build_props()
_layouts = OrderedDict()
_layouts["mg"] = {"layout": [mg_props], "title": "metrics-graphics"}
register_layouts(_layouts, mod)
del mg_ui
class MyDataWrapper(object):
""" We are building a simple wrapper for our data """
def __init__(self,df, x, y, timeseries=True):
self.df = df
self.x = x
self.y = y
self.timeseries = timeseries
def my_route_function(self):
# put args check here
args = {}
init_params = {"Data": "Steps"}
for c in init_params:
if request.args.get(c):
args[c] = request.args[c]
else:
args[c] = init_params[c]
return jsonify(LineChart.to_json(Chart.apply_filters(self.df, args), self.x, self.y, timeseries=self.timeseries))
Plz if somebody can help me to solve this problem i will appreciate it a lot
Hi!,
when we will have a documentation?
I don't can wait for this...
Questions:
I run four examples,but it always -->react.jsx.TransformError, I can't make it,I need help!!!
Hi Pyxley Team ,
first of all congratulation for the Wonderfull framework . I have one query here if i would like to create a line chart given in example metricsgraphics with date - time(x- axis) so what should be format of Date Column in the csv file for date - time(x axis) .
dateparse = lambda x: pd.datetime.strptime(x, '%Y-%m-%d %H:%M:%S')
df = pd.read_csv("fitbit_data.csv", parse_dates=['Date'], date_parser=dateparse)
sf = df.set_index("Date").stack().reset_index()
i have already tried but line charts failed with Date as %Y-% m-%d %H:%M:%S. line charts only works well with date format as %Y-% m-%d .
I have never used pyxley before and i will need to use it for my uni project but i am not sure how to make it work. So could someone provide me with instructions of how to make it work please.
I want to refresh the data every 30s, how to achieve it without restarting the service?
Hi team,
Is it possible to load pyxley charts and datatable from jQuery. My scenario is to get lot of details from html controls and show chart or datatable from jQuery
Thanks in advance
Venkatesan S
I had difficulty following your README to install bower. I'm using Linux Mint 17.2 (Ubuntu 14.04). The following is a little exhaustive, hopefully it'll help more-knowledgable Ubuntu users through the process and they could help tighten up the Linux compatibility.
Inside pyxley/examples/datamaps/README.md
it notes
## NPM
Install NPM (e.g brew install node). Then run `npm install -g` in the directory containing
package.json. `-g` will make bower available globally.
I'm not a bower
or node
dev so this bit was a little trial-and-error. It seems I had the Ubuntu nodejs
package installed which doesn't provide a node
executable (nodejs/node-v0.x-archive#3911) but switching to nodejs-legacy
did the job. Next a sudo npm install -g bower
worked.
Next I create the 3-line json .bowerrc
file as you note and bower install
runs, the only question being
Unable to find a suitable version for d3, please choose one:
1) d3#~3.3.8 which resolved to 3.3.13 and is required by datamaps#0.4.0
2) d3#~3.5.5 which resolved to 3.5.6 and is required by datamaps-example
where I opted for 2
.
Out of interest - how come the .bowerrc
file wasn't already in the repo?
Now I see
examples/datamaps $ ls project/static/bower_components/
bootstrap classnames d3 datamaps jquery pyxley react react-bootstrap require topojson
Running the demo in my browser works and I see flask
report 200
codes in the logs (rather than 404
codes before following bower
which I think is the issue here: #4):
examples/datamaps/project $ python app.py
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
127.0.0.1 - - [21/Jul/2015 15:20:22] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:20:23] "GET /static/bower_components/bootstrap/dist/css/bootstrap.min.css HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:20:23] "GET /static/bower_components/jquery/dist/jquery.min.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:20:23] "GET /static/bower_components/d3/d3.min.js HTTP/1.1" 200 -
...
I followed the same process in datatables
and bower
asked
Unable to find a suitable version for d3, please choose one:
1) d3#~3.3.13 which resolved to 3.3.13 and is required by nvd3#1.7.1
2) d3#~3.3.8 which resolved to 3.3.13 and is required by datamaps#0.4.0
3) d3#~3.5.5 which resolved to 3.5.6 and is required by metricsgraphics-example
4) d3#>=3.4.8 which resolved to 3.5.6 and is required by metrics-graphics#2.5.0
Prefix the choice with ! to persist it to bower.json
? Answer: 3
but this time when I ran the demo, although it runs and I see 200
codes, I don't get anything in the browser (not in Chrome or Firefox). This is the only log info I see
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/bootstrap/dist/css/bootstrap.min.css HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/datatables/media/css/jquery.dataTables.min.css HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/css/main.css HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/jquery/dist/jquery.min.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/datatables/media/js/jquery.dataTables.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/dataTables.fixedColumns.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/d3/d3.min.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/require/build/require.min.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/react/react.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/react-bootstrap/react-bootstrap.min.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/conf_int.js HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2015 15:24:41] "GET /static/bower_components/pyxley/build/pyxley.js HTTP/1.1" 200 -
Any clue about what's missing to get the demo working?
after i run the command
python app.py
i raise this error ,even i search by the google ,but i still can not find any suggestion
any one could help?
Hi, I am starting to learn your package and I was trying the example of metricsgraphics.
Installed npm globally, python packages are run in virtualenv (pyenv) with python 2.7, also flask and pyxley are only installed in virtual environment.
The error I get is:
[email protected] install /home/platino/pyceley/pyxley-master/examples/metricsgraphics/node_modules/node-sass
node scripts/install.js
sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
npm ERR! weird error 127
npm ERR! not ok code 0
Traceback (most recent call last):
File "/home/platino/.pyenv/versions/webdashapp/bin/pyxapp", line 24, in
do_init(args)
File "/home/platino/.pyenv/versions/webdashapp/bin/pyxapp", line 20, in do_init
npm.run()
File "/home/platino/.pyenv/versions/2.7.6/envs/webdashapp/lib/python2.7/site-packages/pyxley/utils/npm.py", line 93, in run
run(cmds, cwd=self.repo_root)
File "/home/platino/.pyenv/versions/2.7.6/envs/webdashapp/lib/python2.7/site-packages/pyxley/utils/npm.py", line 13, in run
return check_call(cmd, _args, *_kwargs)
File "/home/platino/.pyenv/versions/2.7.6/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['npm', 'install', '--progress-false']' returned non-zero exit status 1
Is it I am messing with the environments? Thanks a lot
Add plotly support. Still trying to decide how much of the functionality should be left to the developer and how much should be wrapped in some convenience functions.
I've created an example in the webpack branch that I'm building. The base react wrapper will go in the next version of pyxleyJS.
Hi! I'm excitedly working through some of the examples and I ran into the issue below:
$python app.py
Traceback (most recent call last):
File "app.py", line 47, in <module>
transformer.transform(f,js_path=jsx_output+f.split('/')[-1])
File "/usr/local/lib/python2.7/dist-packages/react/jsx.py", line 53, in transform
with open(js_path, 'wb') as o:
IOError: [Errno 2] No such file or directory: 'static/js/custom.js'
Upon cloning only the static/jsx directory exists and creating the static/js directory fixes things though.
Have a data table which has some numeric columns. I am not able to get those columns to either be right justified or take num-fmt or even to add some text through a render fn. I am not a datatables/javascript expert so could be doing something basic wrong.
All help appreciated!
Here are my three different attempts
This should work! Inspecting the option in React/Javascript debugger shows as if the definition is ok
Trying to add fmt - all other cols appear in table but this col shows undefined
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"type": "html",
"targets": [0]
}])
This should work! Inspecting the option in React/Javascript debugger shows as if the definition is ok
Trying to just add "(abc)" to value of each row in col 0 (as a test)
tb = DataTable("pltable", "/pltable/", latestPL, columns=cols, paging=True, searching=True, sortable=True, pageLength=40,
columnDefs=[{
"render": function ( data, type, row ) {
return data +' ('+ 'abc' +')';
},
"targets": 0
}])
This does not compile. If I surround function with """ then it emits the func as a character string in the react structure.
Hi there,
I just came across this library and was wondering whether it is able to deal with tabs and side bar alike menu? Is there any way to render them directly thru pyxley ?
Looked to the source code but did not found any hints
Best regards
I am getting below error in javascript on rendering a pie chart
Uncaught TypeError: this.chart.x(...).y(...).showLabels(...).labelType(...).showLegend(...).labelsOutside is not a function
code:
col = OrderedDict([
("Floors", {"label": "Floors"})
])
df = pd.read_csv("fitbit_data.csv")
pc=PieChart(col,df["Floor"], init_params={},chart_id="piechart", url="/piechart/", colors=[],label_type="percent")
ui.add_chart(pc)
......
Dear NickKridler,
I am a newbie to Python and I am following your tutorial and the examples.I am trying to create a dashboard with the described technologies, I tried to create a dashboard like the first image what you mentioned in the example.But I am unable to get it and I am getting like one by one.
1)So could you please help me to solve this and
2)let me know how to add the labels for x and y axises.
3)One more thing is while we are trying with other packages for plotting rather than Plyxley we are getting errors .Shall we use Plyxley or we can try with other packages also?
Please help us to solve this.
Thanks
The static/layout.js file has True instead of true and False instead of false in line 5.
I thought I will make a pull request and even forked, but the layout.js file comes after the bower install and hence I am not sure how I can fix it for the main repo.
If there is a way I can help, let me know, I will send a pull :)
Hi, after executing $ npm init pyxapp
and npm install
, I'm coming across a couple other errors:
`ERROR in C:/Users/phill/pxy//pyxley/build/pyxley.js/pyxley/build/pyxley.js 1:99-119
Module not found: Error: Cannot resolve module 'react-dom' in C:\Users\phill\pxy\node_modules\pyxley\build
@ C:/Users/phill/pxy/
ERROR in C:/Users/phill/pxy//pyxley/build/pyxley.js/pyxley/build/pyxley.js 1:120-133
Module not found: Error: Cannot resolve module 'd3' in C:\Users\phill\pxy\node_modules\pyxley\build
@ C:/Users/phill/pxy/
ERROR in C:/Users/phill/pxy//pyxley/build/pyxley.js/pyxley/build/pyxley.js 1:0-27
Module not found: Error: Cannot resolve module 'metrics-graphics' in C:\Users\phill\pxy\node_modules\pyxley\build
@ C:/Users/phill/pxy/
ERROR in C:/Users/phill/pxy//pyxley/build/pyxley.js/pyxley/build/pyxley.js 1:0-20
Module not found: Error: Cannot resolve module 'plotly.js' in C:\Users\phill\pxy\node_modules\pyxley\build
@ C:/Users/phill/pxy/
ERROR in C:/Users/phill/pxy//pyxley/build/pyxley.js/pyxley/build/pyxley.js 1:0-17
Module not found: Error: Cannot resolve module 'jquery' in C:\Users\phill\pxy\node_modules\pyxley\build
@ C:/Users/phill/pxy/
ERROR in C:/Users/phill/pxy//pyxley/build/pyxley.js/pyxley/build/pyxley.js 1:0-19
Module not found: Error: Cannot resolve module 'datamaps' in C:\Users\phill\pxy\node_modules\pyxley\build
@ C:/Users/phill/pxy/
ERROR in C:/Users/phill/pxy//pyxley/build/pyxley.js/pyxley/build/pyxley.js 1:0-15`
Module not found: Error: Cannot resolve module 'nvd3' in C:\Users\phill\pxy\node_modules\pyxley\build
@ C:/Users/phill/pxy/
What am I doing wrong here? I checked and my react-dom is version 0.14.7
I am new to pyxley. I tried to follow the instruction and make the metricsgraphics exmaple work. I am not quite sure how to initialize the folder by typing "pyxapp --init .", where and how should I type this command? I am using windows 7 and have pyxley&npm properly installed.
[x] Bug (Typo)
maddness
, however expect to see madness
.wepback
, however expect to see webpack
.substract
, however expect to see subtract
.recativate
, however expect to see reactivate
.predictible
, however expect to see predictable
.colapse
, however expect to see collapse
.Semi-automated issue generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md
To avoid wasting CI processing resources a branch with the fix has been
prepared but a pull request has not yet been created. A pull request fixing
the issue can be prepared from the link below, feel free to create it or
request @timgates42 create the PR. Alternatively if the fix is undesired please
close the issue with a small comment about the reasoning.
https://github.com/timgates42/pyxley/pull/new/bugfix_typos
Thanks.
OS:Mac os 10.11.2 (15C50)
Python Version:2.7.11
after i try to run the app.py ,i got this error information:
File "/Users/brucedone/anaconda/lib/python2.7/site-packages/matplotlib/init.py", line 1000, in _open_file_or_url
encoding = locale.getdefaultlocale()[1]
File "/Users/brucedone/anaconda/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
File "/Users/brucedone/anaconda/lib/python2.7/locale.py", line 475, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
then i google it find the solution like this one:
http://stackoverflow.com/questions/19961239/pelican-3-3-pelican-quickstart-error-valueerror-unknown-locale-utf-8:
then after i do the all things and output this
○ → python -c 'import locale; print(locale.getdefaultlocale());'
('en_US', 'UTF-8')
it seems i have already add the utf-8 coding to my system.
but i still got error while i try to run the app.py
anyone could help ?
First of all, a huge fan of Pyxley and how easy it is to get up and running.
I'm curious when the pyxley in production portion of the tutorial/doc will be written? https://media.readthedocs.org/pdf/pyxley/latest/pyxley.pdf
I know there's a template #27 and it's not yet documented.
Any guidance would be appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.