Skip to content

Clone dash-core-components for refresh #3408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ dash/dcc/*
!dash/dcc/.gitkeep
dash/dash_table/*
!dash/dash_table/.gitkeep
dash/dcc_refresh/*
!dash/dcc_refresh/.gitkeep
develop-eggs/
dist/
downloads/
Expand Down
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ignore-patterns=
# Add files or directories matching the regex patterns to the ignore-list.
# The regex matches against paths.
ignore-paths=^dash/dcc/.*$,
^dash/dcc_refresh/.*$,
^dash/html/.*$,
^dash/dash_table/.*$

Expand Down
138 changes: 138 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
from multiprocessing import Lock, Value

from dash import (
Dash,
Input,
Output,
html,
# dcc,
dcc_refresh as dcc,
)

lock = Lock()

app = Dash(__name__)
server = app.server

app.layout = html.Div(
[
html.Label([
html.P("DatePicker"),
dcc.DatePickerRange(id="dpr", clearable=True),
dcc.DatePickerSingle(id="dps", clearable=True),
]),
html.Label([
html.P("Slider"),
dcc.Slider(
min=0,
max=100,
marks={0: '0', 15: '15', 25: '25', 50: '50', 75: '75', 100: '100'},
value=75,
id="slider",
# tooltip={"always_visible": True, "transform": "transformTooltip"},
),
]),
html.Label([
html.P("Vertical Range Slider"),
dcc.RangeSlider(
id="vertical-range-slider",
min=0,
max=9,
marks={i: f"Label {i}" if i == 1 else str(i) for i in range(1, 6)},
value=[4, 6],
vertical=True,
verticalHeight=300,
),

]),
html.Label([
html.P("Range Slider"),
dcc.RangeSlider(
min=0,
max=100,
step=1,
id="range-slider",
marks={0: '0', 15: '15', 25: '25', 50: '50', 75: '75', 100: '100'},
value=[25, 75]
),
]),
html.Label([
html.P("Vertical Slider"),
dcc.Slider(
id="vertical-slider",
vertical=True,
min=0,
max=5,
value=3,
marks={i: f"Label {i}" for i in range(-1, 10)}
)
], style={"width": "300px", "display": "block"}),

html.Div(id="slider1"),
html.Div(id="slider2"),
html.Label([
html.P("Text"),
dcc.Input(id="input", value="initial value", debounce=True, type=None),
]),
html.Label([
html.P("Text"),
dcc.Input(id="disabled", value="initial value", disabled=True),
]),
html.Label([
html.P("Number"),
dcc.Input(id="number", value=17, type="number", min=10, max=23),
]),
html.Label([
html.P("Password"),
dcc.Input(id="password", value=17, type="password", minLength=10),
]),
html.Label([
html.P("Email"),
dcc.Input(id="email", type="email"),
]),
html.Label([
html.P("Range"),
dcc.Input(id="range", type="range"),
]),
html.Label([
html.P("Search"),
dcc.Input(id="search", type="search"),
]),
html.Label([
html.P("Tel"),
dcc.Input(id="tel", type="tel"),
]),
html.Label([
html.P("URL"),
dcc.Input(id="url", type="url"),
]),
html.Label([
html.P("Hidden"),
dcc.Input(id="hidden", type="hidden"),
]),
html.Div(id="output-1"),
]
)
call_count = Value("i", 0)


@app.callback(Output("slider1", "children"), [Input("vertical-slider", "drag_value")])
def update_drag_value(value):
return f"Slider drag_value: {value}"

@app.callback(Output("slider2", "children"), [Input("vertical-slider", "value")])
def update_value(value):
return f"Slider value: {value}"

app.clientside_callback(
"""
function(value) {
//alert(value);
}
""",
Input("input", "value"),
)


if __name__ == "__main__":
app.run(debug=True, port=8051)
18 changes: 18 additions & 0 deletions components/dash-core-components-refresh/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# EditorConfig is awesome: https://EditorConfig.org

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Matches multiple files with brace expansion notation
# Set default charset
[*.{js,py}]
charset = utf-8
indent_style = space
indent_size = 4

# Matches the exact files either package.json or .travis.yml
[{package.json,.circleci/config.yml}]
indent_style = space
indent_size = 2
17 changes: 17 additions & 0 deletions components/dash-core-components-refresh/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build/
dist/
lib/
lib/bundle.js*
coverage/
node_modules/
packages/
.npm
vv/
venv/
*.pyc
*.egg-info
*.log
.idea/
.DS_Store
dash_core_components/
config/
126 changes: 126 additions & 0 deletions components/dash-core-components-refresh/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"extends": ["eslint:recommended", "plugin:react/recommended", "prettier"],
"settings": {
"react": {"version": "detect"}
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": true,
"generators": true,
"modules": true,
"templateStrings": true,
"jsx": true
}
},
"env": {
"browser": true,
"es6": true,
"jasmine": true,
"node": true
},
"plugins": [
"react",
"import"
],
"parser": "@babel/eslint-parser",
"rules": {
"accessor-pairs": ["error"],
"block-scoped-var": ["error"],
"consistent-return": ["error"],
"curly": ["error", "all"],
"default-case": ["error"],
"dot-location": ["off"],
"dot-notation": ["error"],
"eqeqeq": ["error"],
"guard-for-in": ["off"],
"import/export": "error",
"import/named": ["off"],
"import/namespace": ["off"],
"import/no-duplicates": ["error"],
"import/no-named-as-default": ["off"],
"import/no-unresolved": ["off"],
"new-cap": ["error", {
"capIsNewExceptionPattern": "Immutable\\.*"
}],
"no-alert": ["off"],
"no-caller": ["error"],
"no-case-declarations": ["error"],
"no-console": ["error"],
"no-div-regex": ["error"],
"no-dupe-keys": ["error"],
"no-else-return": ["error"],
"no-empty-pattern": ["error"],
"no-eq-null": ["error"],
"no-eval": ["error"],
"no-extend-native": ["error"],
"no-extra-bind": ["error"],
"no-extra-boolean-cast": ["error"],
"no-inline-comments": ["off"],
"no-implicit-coercion": ["off"],
"no-implied-eval": ["error"],
"no-inner-declarations": ["off"],
"no-invalid-this": ["error"],
"no-iterator": ["error"],
"no-labels": ["error"],
"no-lone-blocks": ["error"],
"no-loop-func": ["error"],
"no-multi-str": ["error"],
"no-native-reassign": ["error"],
"no-new": ["error"],
"no-new-func": ["error"],
"no-new-wrappers": ["error"],
"no-param-reassign": ["off"],
"no-process-env": ["warn"],
"no-proto": ["error"],
"no-prototype-builtins": ["off"],
"no-redeclare": ["error"],
"no-return-assign": ["error"],
"no-script-url": ["error"],
"no-self-compare": ["error"],
"no-sequences": ["error"],
"no-shadow": ["off"],
"no-throw-literal": ["error"],
"no-unused-expressions": ["error"],
"no-use-before-define": ["error", "nofunc"],
"no-useless-call": ["error"],
"no-useless-concat": ["error"],
"no-with": ["error"],
"prefer-const": ["error"],
"radix": ["error"],
"react/jsx-no-duplicate-props": ["error"],
"react/jsx-no-undef": ["error"],
"react/jsx-uses-react": ["error"],
"react/jsx-uses-vars": ["error"],
"react/no-did-update-set-state": ["error"],
"react/no-direct-mutation-state": ["error"],
"react/no-is-mounted": ["error"],
"react/no-unknown-property": ["error", {"ignore": ["jsx"]}],
"react/prefer-es6-class": ["error", "always"],
"react/prop-types": "error",
"valid-jsdoc": ["off"],
"yoda": ["error"],
"spaced-comment": ["error", "always", {
"block": {
"exceptions": ["*"]
}
}],
"no-unused-vars": ["error", {
"args": "after-used",
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^e$"
}],
"no-magic-numbers": ["error", {
"ignoreArrayIndexes": true,
"ignore": [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 100, 10, 16, 0.5, 25, 1000]
}],
"no-underscore-dangle": ["off"],
"no-useless-escape": ["off"]
}
}
5 changes: 5 additions & 0 deletions components/dash-core-components-refresh/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
ignore = C901, E203, E231, E266, E501, E731, W503
select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
30 changes: 30 additions & 0 deletions components/dash-core-components-refresh/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.build_cache/
build/
dist/
lib/
lib/bundle.js*
Project.toml
coverage/
node_modules/
.npm
vv/
venv/
.tox
*.pyc
*.egg-info
*.log
.idea/
.DS_Store

/build
/dash_core_components_refresh
dash_core_components_base/plotly.min.js
dash_core_components_base/mathjax.js
/deps
/inst
/man
/R
/src/*.jl
/src/jl/
DESCRIPTION
NAMESPACE
6 changes: 6 additions & 0 deletions components/dash-core-components-refresh/.lib.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
["@babel/preset-env", { "exclude": ["proposal-dynamic-import"] }],
"@babel/preset-react"
]
}
7 changes: 7 additions & 0 deletions components/dash-core-components-refresh/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"arrowParens": "avoid",
"tabWidth": 4,
"singleQuote": true,
"bracketSpacing": false,
"trailingComma": "es5"
}
Loading
Loading