question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bootstrap integration with dash

See original GitHub issue

Below is my css,jquery & min.js code ` my_css_url = “https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css” app.css.append_css({ “external_url”: my_css_url }) my_jquery = “https://code.jquery.com/jquery-3.1.0.js” app.scripts.append_script({ “external_url”: my_jquery })

my_js_url = “https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js” app.scripts.append_script({ “external_url”: my_js_url }) `

I am able to get css & jquery of the bootstrap but getting below errors.

plotly-1.31.0.min.js:13 Error: <rect> attribute height: A negative value is not valid. (“-14”) in browser developer tools.

What should i do in order to get rid of these errors.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LichpinOwlcommented, Jan 6, 2019

import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import plotly as py

external_css = [‘https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css’]

external_js = [‘https://code.jquery.com/jquery-3.3.1.slim.min.js’, ‘https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js’, ‘https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js’ ]

app = dash.Dash(name)

for css in external_css: app.css.append_css({“external_url”: css}) for js in external_js: app.scripts.append_script({“external_url”: js}) app.layout = html.Div([ html.Div([ html.H1([‘Hello world !’], className=[‘col-4’, ‘d-flex’, ‘justify-content-center’ , ‘bg-secondary’]), html.Div([‘btn’], className=[‘btn’, ‘btn-danger’]) ], className=[‘row’]) ], className=[‘container’])

if name == ‘main’: app.run_server(debug = True)



Running on http://127.0.0.1:8050/ Debugger PIN: 296-361-685 c:\Python27\lib\site-packages\dash\resources.py:45: UserWarning:

A local version of https://code.jquery.com/jquery-3.3.1.slim.min.js is not available

c:\Python27\lib\site-packages\dash\resources.py:45: UserWarning:

A local version of https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js is not available

c:\Python27\lib\site-packages\dash\resources.py:45: UserWarning:

A local version of https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js is not available

Running on http://127.0.0.1:8050/ Debugger PIN: 041-543-092

1reaction
ned2commented, Feb 3, 2018

html.Div(children="First Div", style={"class": "col-md-6"})

should be

html.Div(children="First Div", className="col-md-6")

As I mentioned in the above comment, mixing Bootstrap JavaScript (which uses jQuery) is probably not a good idea as it will conflict with React, which Dash uses. If you’re just using the Boostrap’s CSS, then remove the JS file, it’s not necessary.

Also these sorts of questions are best asked over on the Dash community forum 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dash Bootstrap Components
Bootstrap components are available as native Dash components to let you easily incorporate them into your Dash apps. Each component exposes a number...
Read more >
How to embed Bootstrap CSS & JS in your Python Dash app
Through this tutorial I will explain step by step how Bootstrap can be easily integrated in Dash and how to build and deploy...
Read more >
Dash and Bootstrap: Bring Your Projects to Life in a Beautiful ...
You can have a simple dashboard up and running in ten minutes to highlight some data or trends or you can create stunning...
Read more >
Any sample or guideline to use Bootstrap 4 with Dash?
A friend of mine and I build a front end with Boostrap , HTML and CSS, in a flask frame work and integrated...
Read more >
Dash-bootstrap-components.jl - Julia Packages
dash -bootstrap-components doesn't come with CSS included. This is to give you the freedom to use any Bootstrap v4 stylesheet of your choice....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found