-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
maintaining new lines from text file displayed in Dash #105
Comments
This is a really good question and gets to something that a lot of users has requested: rendering plain HTML strings in Dash. This is not possible right now. I've avoided a pure HTML renderer for a few reasons: That being said, the use case that you describe is valid. I see two ways forward:
|
Hi Chris, Thanks very much for the detailed response. Similar in spirit to your 2nd approach, I ended up putting my text data into a dataframe and using a utility function from the Dash tutorial (part 1) to render the data as an html table. Because I really wanted each line/paragraph in my text data to be readable, the html table worked perfectly as it organized the text beautifully. This is the utility function I took from your tutorial:
I want to emphasize the fact that I am coming from a neuroscience/signal processing background. And so although I can program in python, I am out of my league when it comes to web programming, especially when it comes to understanding the intricacies of writing shareable web applications. All that to say that as someone with my background, Dash was the only program that worked for me throughout my development cycle (python code -> locally served application -> shareable application (via Heroku)). In particular, the Dash documentation was really "at my level" and I appreciated the step-by-step, full-circle instructions. Thanks very much, |
Thanks for the support @Alcampopiano ! Here's another solution from the community forums (link). If converting the HTML string to the html.Iframe(srcDoc=my_html_string) I haven't tested this thoroughly myself. |
fix arrow highlight issue
Hi there,
I checked the community support page but could not find this topic.
First of all, I love Dash. Complete game changer for me.
Anyway, I'm trying to build a web app that displays the contents of a Word document. Now, in the past I converted the Word doc to html and displayed it inside Jupyter lab's html text widget, and the html was rendered perfectly. In Dash I have tried doing this by converting the Word to html, then displaying the children as markdown (e.g.,
html.Div([dcc.Markdown(children=md)], id='md-values')
. I have also tried just putting the children into a HTML.div directly. However, probably no surprise that the output is not rendered to rich text. Even if I feed plain text to Dash, none of the newlines are maintained. The text is wrapped and very difficult to read.Can you think of way I could achieve what I'm trying to do here?
Thanks very much,
Allan
The text was updated successfully, but these errors were encountered: