I made a notebook in VSC with some plotly histograms. They show up in VSC under the cell as expected. However when I convert to html with jupyter nbconvert --to html --no-input main.ipynb and then load the html file in my browser, those graphs don't show up. There is a missing place where they should be. I can see the div in the inspect window but they're just blank space. In the console I see
file:///C:/localpath/plotly.js net::ERR_FILE_NOT_FOUND
which is deriving from (among others)
h.load # require.min.js:34
The require.min.js is from https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js
I tried manually adding <script src="https://cdn.plot.ly/plotly-2.18.0.min.js"></script> to the html file after the title but before the <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>.
I can see in my network activity that it downloads that js file but then it still tries to download the local version. I searched the html file and there's no direct reference to plotly.js so it seems it's some interaction with that require.js
If I manually download https://cdn.plot.ly/plotly-2.18.0.min.js and save it to the same directory as the html file and rename it to plotly.js then it works but I don't want to have to do that because then it makes sharing the html file extra cumbersome.
How do I get the html file from my notebook to load the remote plotly.js instead of insisting on it coming from a local file at the same relative path?
I needed to change my renderer to notebook_connected
import plotly.io as pio
pio.renderers.default = "notebook_connected
Related
I'm trying to use Britechart library to place a pie chart in my web page, the styling is imported correctly but I can't update the content of the HTML page, it always show the default values (I copied the whole div element form the documentation of britechart)
It does not produce any error but this warning in the console:
This issue is addressed multiple time here but all suggested solutions didn't work for me.
I tried:
Removing the line of source map in the britechart.min.js file //# sourceMappingURL=britecharts.min.js.map, it removes the warning but the content is not updated.
Including the library from cdn instead of a local file.
Removing the extensions from google chrome.
Is there something else that I'm missing?. I would appreciate your help!
I have zero knowledge with regard to coding. I desperately need to download a pdf file which is being shown in the fashion attached to this post. The download button is not working and I've tried everything which I can to download the file. Any help is welcome. Things which I've tried are
Finding file source in network tab under inspect element
Finding any URl leading to the pdf again in the inspect elements tab.
Saving the page as Html, upon which it downloads but never opens again with the pdf required.
Also in my limited research which I could make sense of was, the page used canvas element to render the pdf. Text of pdf is seen to be entered manually in a separate layer.
The address of the pdf being rendered is actually visible in the url on your image.
the ../../ means go up 2 directories.
So that means the absolute url for your pdf is this.
https://www.time4education.com/MoodlePages/catmttt/cat20materialvideos/VAHO1002103.pdf
I'm working through Django By Example and in one chapter a jQuery bookmarklet is built within a Django app so that a user can easily save jpg images from a website into their user profile area within the Django app.
The tutorial does give exact instructions on what to do which I have followed and although I have managed to get the bookmarklet button to appear in my bookmarks bar in Chrome, nothing happens when I click it when browsing a webpage with jpg images.
This is my local Django dashboard where the bookmarklet button is added to the bookmarks bar and this part works fine
and this is how it must look like when clicked on the bookmarklet, this is the part where nothing happens for me when I clicked on bookmarklet.
(how to solve this?)
These are the relevant js files
https://github.com/davejonesbkk/bookmarks/blob/master/images/templates/bookmarklet_launcher.js
https://github.com/davejonesbkk/bookmarks/blob/master/images/static/js/bookmarklet.js
I believe the JavaScript launcher is unable to load the JavaScript files or the JS launcher itself is not getting loaded.
The JavaScript launcher is getting called through a Django template tag "include" inside the anchor tag.
this is the link:
https://github.com/davejonesbkk/bookmarks/blob/master/account/templates/account/dashboard.html
I tried debugging it through CTRL+SHIFT+I console where trouble showed that "include" tag not working properly.
Your include tag is split over two lines:
images from other websites → <a href="javascript:{% include
"bookmarklet_launcher.js" %}" class="button">Bookmark it</a><p>
Django does not support multiple line tags. Change it to:
images from other websites → Bookmark it<p>
I have faced the similar error while going through the book.
The bookmark button is not functioning,when i debugged it through chrome debugger,i could able to see errors at js level.I have made two changes to resolve these errors.
1.Error message: net::ERR_ABORTED
Action step:
In the book its mentioned that to place bookmarklet.js in images application directory,but in bookmarklet_launcher.js the source is refered to below path
http://127.0.0.1:8000/static/js/bookmarklet.js?r=
So place bookmarklet.js in /static/js/ directory inside images application(if folder structure not available create it).
2.Error message: net::ERR_ABORTED
There is one more file that should be placed which is bookmarklet.css which is being refereed at below line in bookmarklet.js.
href: static_url + 'css/bookmarklet.css?r=' + Math.floor(Math.random()*99999999999999999999)
Action step:
create a file bookmarklet.css inside /static/css/ directory and place the css code.Refer below link for css code:
Git Hub link for css code reference
1.After the above steps,restart the development server.
2.Drag the bookmark it button to create a bookmark in browser.
3.Open any website that is HTTP(not https) and click on bookmark it(The one which is bookmarked in browser not bookmark it button).
4.The below pop up appears
the problem is that template doesn't exist so try t do the following
**
1. make sure your include code in same line
2. make sure same name of the template exist on your project director /images/templates/file_name.js.
3. or go to setting and add your templates directory to templates.
4. if it load but no images views don't forget that you only accept jpeg and jpg images only
** so you can try another sites like wikipedia **
I was able to solve this by making sure that the url from ngrok tunnel in the bookmarklet.js and bookmarklet_luncher.js starts with https not http
Instead of this http://127.0.0.1:8000/static/js/bookmarklet.js?r= it should rather be
https://127.0.0.1:8000/static/js/bookmarklet.js?r=
After 4 hours of doing everything... googling, deleting code, and rewriting code...
Only had to hit Ctrl+C to stop server and re-run server .
Just take a break and come back to fix it :)
Mine works same as instructed in the book – no changes, no nothing.
Only restarted the server.
I need to generate a PDF with an image in the background.
To generate the PDF I'm using jsReport.
I'm using the HTML tag image <img src="Content/img/boleta2.png" /> and this is working great, because when I open this in Firefox, the image shows up.
But when I generate the PDF, only shows the HTML without any image.
In the official page http://jsreport.net/learn/images
it says something like "To upload an image you can use simple http POST...."
But I don't understand this very well.
Content/img/boleta2.png seems like a relative path to somewhere. In every case jsreport has no idea what is the full path.
You can use html base tag to specify the root path http://www.w3schools.com/tags/tag_base.asp
Or you can use full path directly in the img src.
The image extension is used for uploading images directly into the jsreport storage where it can be later referenced. Image is uploaded usually from html jsreport studio, the mention about http POST is about using API what is an advanced use case you probably don't struggle with right now.
I've downloaded the following page:
http://chartjs.devexpress.com/Demos/VizGallery/#chart/circulargaugesbasicelementspaletteforranges
But when I open the local html shows a blank page. My idea was changing the example acording to my needs. Does anyone know how to make the local page works?
That demo is accessible in ZIP packages which you can download from ChartJS site
You can open corresponding file
DevExpressChartJS-13.2.7.zip\Demos\VizGallery\demos\Circular Gauges\Basic Elements\Palette for Ranges.html
And modify it.
You also can mofify code directly on page which you linked using online code editor (but you won't be able to save results)