Skip to content

Commit a99b2bd

Browse files
committed
Clone dash-core-components for refresh
1 parent 16243ec commit a99b2bd

File tree

174 files changed

+42224
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+42224
-167
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ dash/dcc/*
4949
!dash/dcc/.gitkeep
5050
dash/dash_table/*
5151
!dash/dash_table/.gitkeep
52+
dash/dcc_refresh/*
53+
!dash/dcc_refresh/.gitkeep
5254
develop-eggs/
5355
dist/
5456
downloads/

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ignore-patterns=
1616
# Add files or directories matching the regex patterns to the ignore-list.
1717
# The regex matches against paths.
1818
ignore-paths=^dash/dcc/.*$,
19+
^dash/dcc_refresh/.*$,
1920
^dash/html/.*$,
2021
^dash/dash_table/.*$
2122

app.py

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
from multiprocessing import Lock, Value
2+
3+
from dash import (
4+
Dash,
5+
Input,
6+
Output,
7+
html,
8+
# dcc,
9+
dcc_refresh as dcc,
10+
)
11+
12+
lock = Lock()
13+
14+
app = Dash(__name__)
15+
server = app.server
16+
17+
app.layout = html.Div(
18+
[
19+
html.Label([
20+
html.P("DatePicker"),
21+
dcc.DatePickerRange(id="dpr", clearable=True),
22+
dcc.DatePickerSingle(id="dps", clearable=True),
23+
]),
24+
html.Label([
25+
html.P("Slider"),
26+
dcc.Slider(
27+
min=0,
28+
max=100,
29+
marks={0: '0', 15: '15', 25: '25', 50: '50', 75: '75', 100: '100'},
30+
value=75,
31+
id="slider",
32+
# tooltip={"always_visible": True, "transform": "transformTooltip"},
33+
),
34+
]),
35+
html.Label([
36+
html.P("Vertical Range Slider"),
37+
dcc.RangeSlider(
38+
id="vertical-range-slider",
39+
min=0,
40+
max=9,
41+
marks={i: f"Label {i}" if i == 1 else str(i) for i in range(1, 6)},
42+
value=[4, 6],
43+
vertical=True,
44+
verticalHeight=300,
45+
),
46+
47+
]),
48+
html.Label([
49+
html.P("Range Slider"),
50+
dcc.RangeSlider(
51+
min=0,
52+
max=100,
53+
step=1,
54+
id="range-slider",
55+
marks={0: '0', 15: '15', 25: '25', 50: '50', 75: '75', 100: '100'},
56+
value=[25, 75]
57+
),
58+
]),
59+
html.Label([
60+
html.P("Vertical Slider"),
61+
dcc.Slider(
62+
id="vertical-slider",
63+
vertical=True,
64+
min=0,
65+
max=5,
66+
value=3,
67+
marks={i: f"Label {i}" for i in range(-1, 10)}
68+
)
69+
], style={"width": "300px", "display": "block"}),
70+
71+
html.Div(id="slider1"),
72+
html.Div(id="slider2"),
73+
html.Label([
74+
html.P("Text"),
75+
dcc.Input(id="input", value="initial value", debounce=True, type=None),
76+
]),
77+
html.Label([
78+
html.P("Text"),
79+
dcc.Input(id="disabled", value="initial value", disabled=True),
80+
]),
81+
html.Label([
82+
html.P("Number"),
83+
dcc.Input(id="number", value=17, type="number", min=10, max=23),
84+
]),
85+
html.Label([
86+
html.P("Password"),
87+
dcc.Input(id="password", value=17, type="password", minLength=10),
88+
]),
89+
html.Label([
90+
html.P("Email"),
91+
dcc.Input(id="email", type="email"),
92+
]),
93+
html.Label([
94+
html.P("Range"),
95+
dcc.Input(id="range", type="range"),
96+
]),
97+
html.Label([
98+
html.P("Search"),
99+
dcc.Input(id="search", type="search"),
100+
]),
101+
html.Label([
102+
html.P("Tel"),
103+
dcc.Input(id="tel", type="tel"),
104+
]),
105+
html.Label([
106+
html.P("URL"),
107+
dcc.Input(id="url", type="url"),
108+
]),
109+
html.Label([
110+
html.P("Hidden"),
111+
dcc.Input(id="hidden", type="hidden"),
112+
]),
113+
html.Div(id="output-1"),
114+
]
115+
)
116+
call_count = Value("i", 0)
117+
118+
119+
@app.callback(Output("slider1", "children"), [Input("vertical-slider", "drag_value")])
120+
def update_drag_value(value):
121+
return f"Slider drag_value: {value}"
122+
123+
@app.callback(Output("slider2", "children"), [Input("vertical-slider", "value")])
124+
def update_value(value):
125+
return f"Slider value: {value}"
126+
127+
app.clientside_callback(
128+
"""
129+
function(value) {
130+
//alert(value);
131+
}
132+
""",
133+
Input("input", "value"),
134+
)
135+
136+
137+
if __name__ == "__main__":
138+
app.run(debug=True, port=8051)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
8+
# Matches multiple files with brace expansion notation
9+
# Set default charset
10+
[*.{js,py}]
11+
charset = utf-8
12+
indent_style = space
13+
indent_size = 4
14+
15+
# Matches the exact files either package.json or .travis.yml
16+
[{package.json,.circleci/config.yml}]
17+
indent_style = space
18+
indent_size = 2
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
build/
2+
dist/
3+
lib/
4+
lib/bundle.js*
5+
coverage/
6+
node_modules/
7+
packages/
8+
.npm
9+
vv/
10+
venv/
11+
*.pyc
12+
*.egg-info
13+
*.log
14+
.idea/
15+
.DS_Store
16+
dash_core_components/
17+
config/
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
{
2+
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
3+
"settings": {
4+
"react": {"version": "detect"}
5+
},
6+
"parserOptions": {
7+
"ecmaVersion": 2020,
8+
"sourceType": "module",
9+
"ecmaFeatures": {
10+
"arrowFunctions": true,
11+
"blockBindings": true,
12+
"classes": true,
13+
"defaultParams": true,
14+
"destructuring": true,
15+
"forOf": true,
16+
"generators": true,
17+
"modules": true,
18+
"templateStrings": true,
19+
"jsx": true
20+
}
21+
},
22+
"env": {
23+
"browser": true,
24+
"es6": true,
25+
"jasmine": true,
26+
"node": true
27+
},
28+
"plugins": [
29+
"react",
30+
"import"
31+
],
32+
"parser": "@babel/eslint-parser",
33+
"rules": {
34+
"accessor-pairs": ["error"],
35+
"block-scoped-var": ["error"],
36+
"consistent-return": ["error"],
37+
"curly": ["error", "all"],
38+
"default-case": ["error"],
39+
"dot-location": ["off"],
40+
"dot-notation": ["error"],
41+
"eqeqeq": ["error"],
42+
"guard-for-in": ["off"],
43+
"import/export": "error",
44+
"import/named": ["off"],
45+
"import/namespace": ["off"],
46+
"import/no-duplicates": ["error"],
47+
"import/no-named-as-default": ["off"],
48+
"import/no-unresolved": ["off"],
49+
"new-cap": ["error", {
50+
"capIsNewExceptionPattern": "Immutable\\.*"
51+
}],
52+
"no-alert": ["off"],
53+
"no-caller": ["error"],
54+
"no-case-declarations": ["error"],
55+
"no-console": ["error"],
56+
"no-div-regex": ["error"],
57+
"no-dupe-keys": ["error"],
58+
"no-else-return": ["error"],
59+
"no-empty-pattern": ["error"],
60+
"no-eq-null": ["error"],
61+
"no-eval": ["error"],
62+
"no-extend-native": ["error"],
63+
"no-extra-bind": ["error"],
64+
"no-extra-boolean-cast": ["error"],
65+
"no-inline-comments": ["off"],
66+
"no-implicit-coercion": ["off"],
67+
"no-implied-eval": ["error"],
68+
"no-inner-declarations": ["off"],
69+
"no-invalid-this": ["error"],
70+
"no-iterator": ["error"],
71+
"no-labels": ["error"],
72+
"no-lone-blocks": ["error"],
73+
"no-loop-func": ["error"],
74+
"no-multi-str": ["error"],
75+
"no-native-reassign": ["error"],
76+
"no-new": ["error"],
77+
"no-new-func": ["error"],
78+
"no-new-wrappers": ["error"],
79+
"no-param-reassign": ["off"],
80+
"no-process-env": ["warn"],
81+
"no-proto": ["error"],
82+
"no-prototype-builtins": ["off"],
83+
"no-redeclare": ["error"],
84+
"no-return-assign": ["error"],
85+
"no-script-url": ["error"],
86+
"no-self-compare": ["error"],
87+
"no-sequences": ["error"],
88+
"no-shadow": ["off"],
89+
"no-throw-literal": ["error"],
90+
"no-unused-expressions": ["error"],
91+
"no-use-before-define": ["error", "nofunc"],
92+
"no-useless-call": ["error"],
93+
"no-useless-concat": ["error"],
94+
"no-with": ["error"],
95+
"prefer-const": ["error"],
96+
"radix": ["error"],
97+
"react/jsx-no-duplicate-props": ["error"],
98+
"react/jsx-no-undef": ["error"],
99+
"react/jsx-uses-react": ["error"],
100+
"react/jsx-uses-vars": ["error"],
101+
"react/no-did-update-set-state": ["error"],
102+
"react/no-direct-mutation-state": ["error"],
103+
"react/no-is-mounted": ["error"],
104+
"react/no-unknown-property": ["error", {"ignore": ["jsx"]}],
105+
"react/prefer-es6-class": ["error", "always"],
106+
"react/prop-types": "error",
107+
"valid-jsdoc": ["off"],
108+
"yoda": ["error"],
109+
"spaced-comment": ["error", "always", {
110+
"block": {
111+
"exceptions": ["*"]
112+
}
113+
}],
114+
"no-unused-vars": ["error", {
115+
"args": "after-used",
116+
"argsIgnorePattern": "^_",
117+
"caughtErrorsIgnorePattern": "^e$"
118+
}],
119+
"no-magic-numbers": ["error", {
120+
"ignoreArrayIndexes": true,
121+
"ignore": [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 10, 16, 0.5, 25, 1000]
122+
}],
123+
"no-underscore-dangle": ["off"],
124+
"no-useless-escape": ["off"]
125+
}
126+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[flake8]
2+
ignore = C901, E203, E231, E266, E501, E731, W503
3+
select = B,C,E,F,W,T4
4+
per-file-ignores =
5+
tests/*: E722, F811
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.build_cache/
2+
build/
3+
dist/
4+
lib/
5+
lib/bundle.js*
6+
Project.toml
7+
coverage/
8+
node_modules/
9+
.npm
10+
vv/
11+
venv/
12+
.tox
13+
*.pyc
14+
*.egg-info
15+
*.log
16+
.idea/
17+
.DS_Store
18+
19+
/build
20+
/dash_core_components_refresh
21+
dash_core_components_base/plotly.min.js
22+
dash_core_components_base/mathjax.js
23+
/deps
24+
/inst
25+
/man
26+
/R
27+
/src/*.jl
28+
/src/jl/
29+
DESCRIPTION
30+
NAMESPACE
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"presets": [
3+
["@babel/preset-env", { "exclude": ["proposal-dynamic-import"] }],
4+
"@babel/preset-react"
5+
]
6+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"arrowParens": "avoid",
3+
"tabWidth": 4,
4+
"singleQuote": true,
5+
"bracketSpacing": false,
6+
"trailingComma": "es5"
7+
}

0 commit comments

Comments
 (0)