-
-
Notifications
You must be signed in to change notification settings - Fork 144
Conversation
2f5ca2c
to
d0a3847
Compare
@valentijnnieman You wrap the component you want to have a loading with this loading component ? |
@bpostlethwaite I think you mentioned specific loading spinners for Plotly on Friday? If there are any that you think we should incorporate into this component, could you link them here? Thanks in advance :) |
But this one doesn't actually seem to have looping enabled. You'll need to open a GIF editor and enable looping. I am pretty sure we should edit this one in |
If you create a loop version let me know and I'll PR that back into |
Hmm it's very small and blurry. I don't think we should have that as a default loading spinner, would rather have something in like we have here now! Taken from http://tobiasahlin.com/spinkit/ . |
I made this https://codepen.io/Chunkydory/pen/qQOrwB which is a little bit campy! But I kind of like it. @cldougl also pointed out that this exists! https://codepen.io/doeg/pen/RWGoLR |
7172158
to
8cddd1b
Compare
Here's the pen of the cube spinner I just added: https://codepen.io/Chunkydory/pen/aQdpPL |
@valentijnnieman No specific suggestion, just a curated list of spinners |
ce88242
to
88ecff5
Compare
@@ -33,6 +34,7 @@ | |||
"babel-preset-env": "^1.7.0", | |||
"babel-preset-react": "^6.24.1", | |||
"builder": "3.2.2", | |||
"color": "^3.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New dependency used for darkening hex colors, used in the CubeSpinner
component. It allows users to provide a color, and the component will figure out the appropriate darker colors that are used in the cube.
); | ||
}; | ||
|
||
export default LoadingDemo; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New Demo app that shows off the spinners.
@@ -39,7 +39,7 @@ function parseFile(filepath) { | |||
const urlpath = filepath.split(path.sep).join('/'); | |||
let src; | |||
|
|||
if (!['.jsx', '.js'].includes(path.extname(filepath))) { | |||
if (!['.js'].includes(path.extname(filepath))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We currently do not have any .jsx
files in our source code, so I figured they could be used in a way to denote components that should not be picked up by extract-meta, so that we can use them internally in JS. It's an easy solution to have the spinners, in this case, in separate files and not in one huge Loading.react.js
file.
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/theme/xq-light.min.css" /> | ||
<link rel="stylesheet" href="https://unpkg.com/react-select@1.0.0-rc.3/dist/react-select.css" /> | ||
<link rel="stylesheet" href="https://cdn.rawgit.com/chriddyp/abcbc02565dd495b676c3269240e09ca/raw/816de7d5c5d5626e3f3cac8e967070aa15da77e2/rc-slider.css" | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are no longer needed since we supply these CSS files ourselves in the source code (using style-loader
etc)
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/codemirror.min.js"></script> | ||
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/codemirror/5.0.0/mode/javascript/javascript.min.js"></script> | ||
<script type="text/javascript" src="https://unpkg.com/react@15/dist/react.js"></script> | ||
<script type="text/javascript" src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're supplying React in the devDependencies
now, so this is no longer needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I dug through this because it was not obvious to me how the dependencies had changed based on the webpack.config.js and webpack.server.config.js changes in this PR -- they would not affect these script dependencies.
webpack.serve.config.js sets config.externals = undefined
which makes webpack.config.js evaluate 'externals' in overrides
to true which does not set react, react-dom, etc. as defaults.
Not going to ask for changes as this is out of scope, just documenting my own confusion. I think this could be improved on later.
@@ -55,7 +55,7 @@ module.exports = (env, argv) => { | |||
module: { | |||
rules: [ | |||
{ | |||
test: /\.js$/, | |||
test: /\.jsx?$/, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.jsx
files weren't being picked up in the Webpack configs, this will add both .js
and .jsx
files.
config.output = { | ||
filename: './output.js', | ||
path: path.resolve(__dirname), | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the Demo app.
PropTypes.node, | ||
]), | ||
|
||
type: PropTypes.oneOf(['graph', 'cube', 'circle', 'dot', 'default']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add a description docstring here.
<h3 className="dash-loading-title"> | ||
Loading {status.component_name} | ||
's {status.prop_name} | ||
</h3> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😸
… into loading_component
Released as prerelease |
CHANGELOG.md
Outdated
@@ -2,6 +2,9 @@ | |||
All notable changes to this project will be documented in this file. | |||
This project adheres to [Semantic Versioning](http://semver.org/). | |||
|
|||
## [0.44.0] - 2019-02-13 | |||
### Added | |||
- Loading component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreleased, revert version change for final merge. Add issue link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly minor comments and questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not mean to approve just yet :)
Mistake. Not quite there yet!
(Re) released as rc |
R.type(this.props.children) !== 'Object' || | ||
R.type(this.props.children) !== 'Function' | ||
) { | ||
return <div className={className}>{this.props.children}</div>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not using the id passed through props for id+key of this component, normal and loading cases. Might cause similar problems as what we've seen with other comps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're setting key
anywhere in the components, so I don't think it'll cause problems. The key
is set in dash-renderer, however. But, you're right - I should add the id
prop here!
I have installed Is something wrong with my installed packages ? :
|
Hi @eromoe - the packages you'd need are:
It looks like you're missing Here's a link to the forums with a more detailed example of how to use this. |
This is the new Loading component for the new Loading States api issue 267. For now it has a basic default spinner.
Please note!
I've had to make a small change to
extract-meta
to not pick up.jsx
files, so that we can have.jsx
files insrc/
that are not supposed to be mapped to Dash components. This is so that I could split up all the spinners into separate files, that we don't want Dash to pick up as components - instead they should be JS only components that get used under the hood. There's probably a better fix here, let me know your thoughts please.TODO:
loading_screen_style = 'basic' | 'overlay' | 'spinner' | 'empty-div' |
or something similar)SPINNERS:
edit: I'm also showing the component and prop Name in the HTML, just to show off that that information is being passed. In the final version of this component, I'll remove it (or at least change how it looks)
edit2: I've fixed the Demo app and I've added a Loading Demo app that you can fire up to check out all the spinners.
npm start
!