Altair extension for saving charts in a variety of formats.

Overview

Altair Saver

github actions github actions code style black Open in Colab

This packge provides extensions to Altair for saving charts to a variety of output types. Supported output formats are:

  • .json/.vl.json: Vega-Lite JSON specification
  • .vg.json: Vega JSON specification
  • .html: HTML output
  • .png: PNG image
  • .svg: SVG image
  • .pdf: PDF image

Usage

The altair_saver library has a single public function, altair_saver.save(). Given an Altair chart named chart, you can use it as follows:

from altair_saver import save

save(chart, "chart.vl.json")              # Vega-Lite JSON specification
save(chart, "chart.vg.json")              # Vega JSON specification
save(chart, "chart.html")                 # HTML document
save(chart, "chart.html", inline=True)    # HTML document with all JS code included inline
save(chart, "chart.png")                  # PNG Image
save(chart, "chart.svg")                  # SVG Image
save(chart, "chart.pdf")                  # PDF Image

Renderer

Additionally, altair_saver provides an Altair Renderer entrypoint that can display the above outputs directly in Jupyter notebooks. For example, you can specify a vega-lite mimetype (supported by JupyterLab, nteract, and other platforms) with a PNG fallback for other frontends as follows:

alt.renderers.enable('altair_saver', fmts=['vega-lite', 'png'])

Installation

The altair_saver package can be installed with:

$ pip install altair_saver

Saving as vl.json and as html requires no additional setup.

To install with conda, use

$ conda install -c conda-forge altair_saver

The conda package installs the NodeJS dependencies described below, so charts can be saved to png, svg, and pdf without additional setup.

Additional Requirements

Output to png, svg, and pdf requires execution of Javascript code, which altair_saver can do via one of two backends.

Selenium

The selenium backend supports the following formats:

  • .vg.json
  • .png
  • .svg.

To be used, it requires the Selenium Python package, and a properly configured installation of either chromedriver or geckodriver.

On Linux systems, this can be setup as follows:

$ pip install selenium
$ apt-get install chromium-chromedriver

Using conda, the required packages can be installed as follows:

$ conda install -c conda-forge python-chromedriver-binary

The conda approach additionally requires separate installation of a compatible version of Google Chrome, which cannot be done via conda.

Selenium supports other browsers as well, but altair-saver is currently only tested with Chrome.

NodeJS

The nodejs backend supports the following formats:

  • .vg.json
  • .png
  • .svg
  • .pdf

It requires NodeJS, along with the vega-lite, vega-cli, and canvas packages.

First install NodeJS either by direct download or via a package manager, and then use the npm tool to install the required packages:

$ npm install vega-lite vega-cli canvas

Using conda, node and the required packages can be installed as follows:

$ conda install -c conda-forge vega-cli vega-lite-cli

These packages are included automatically when installing altair_saver via conda-forge.

Comments
  • is `alt.renderers.enable('altair_saver', ['vega-lite', 'png'])` on README outdated?

    is `alt.renderers.enable('altair_saver', ['vega-lite', 'png'])` on README outdated?

    ---------------------------------------------------------------------------
    TypeError                                 Traceback (most recent call last)
    <ipython-input-53-092c93936f9f> in <module>
    ----> 1 altair.renderers.enable('altair_saver', ['vega-lite', 'png'])
    
    TypeError: enable() takes from 1 to 2 positional arguments but 3 were given
    

    https://github.com/altair-viz/altair/blob/582b590a29dfbfc06aad27be79371f98a763a0aa/altair/utils/plugin_registry.py#L156

    opened by zyxue 10
  • Add support for passing options to vega CLI utils via `vega_cli_options` kwarg

    Add support for passing options to vega CLI utils via `vega_cli_options` kwarg

    My primary use case is to be able to render interactive charts with multiple renderers (alt.renderers.enable("altair_saver", fmts=["html", "svg"]) without getting warnings about the window coming back and getting rendered into a notebook or other nbconvert export.

    Closes #51. @jakevdp Would love your review and happy to tweak as needed – this was my quick and dirty approach to pass the arguments through, but if there's a more elegant way of doing so, please let me know!

    opened by boydgreenfield 10
  • ValueError: No enabled saver found that supports format='svg'

    ValueError: No enabled saver found that supports format='svg'

    Hello,

    I am trying to generate an SVG figure, but I got an error. Could you please guide me how to fix this? Thank you

    fig_glutathione_seed.save('fig_glutathione_seed.svg')
    
    ---------------------------------------------------------------------------
    ValueError                                Traceback (most recent call last)
    <ipython-input-19-2aedd223090b> in <module>
    ----> 1 fig_glutathione_seed.save('fig_glutathione_seed.svg')
    
    /usr/local/lib/python3.7/site-packages/altair/vegalite/v4/api.py in save(self, fp, format, override_data_transformer, scale_factor, vegalite_version, vega_version, vegaembed_version, **kwargs)
        474         if override_data_transformer:
        475             with data_transformers.disable_max_rows():
    --> 476                 result = save(**kwds)
        477         else:
        478             result = save(**kwds)
    
    /usr/local/lib/python3.7/site-packages/altair/utils/save.py in save(chart, fp, vega_version, vegaembed_version, format, mode, vegalite_version, embed_options, json_kwds, webdriver, scale_factor, **kwargs)
        119             webdriver=webdriver,
        120             scale_factor=scale_factor,
    --> 121             **kwargs,
        122         )
        123         if format == "png":
    
    /usr/local/lib/python3.7/site-packages/altair/utils/mimebundle.py in spec_to_mimebundle(spec, format, mode, vega_version, vegaembed_version, vegalite_version, **kwargs)
         58                 "see http://github.com/altair-viz/altair_saver/".format(fmt=format)
         59             )
    ---> 60         return altair_saver.render(spec, format, mode=mode, **kwargs)
         61     if format == "html":
         62         html = spec_to_html(
    
    /usr/local/lib/python3.7/site-packages/altair_saver/_core.py in render(chart, fmts, mode, embed_options, method, **kwargs)
        253 
        254     for fmt in fmts:
    --> 255         Saver = _select_saver(method, mode=mode, fmt=fmt)
        256         saver = Saver(spec, mode=mode, embed_options=embed_options, **kwargs)
        257         mimebundle.update(saver.mimebundle(fmt))
    
    /usr/local/lib/python3.7/site-packages/altair_saver/_core.py in _select_saver(method, mode, fmt, fp)
         67             if s.enabled() and fmt in s.valid_formats[mode]:
         68                 return s
    ---> 69         raise ValueError(f"No enabled saver found that supports format={fmt!r}")
         70     else:
         71         raise ValueError(f"Unrecognized method: {method}")
    
    ValueError: No enabled saver found that supports format='svg'
    
    opened by biotemon 9
  • Running inside of a crontab

    Running inside of a crontab

    Whenever I am running my code inside of a cron script, I get this error:

    Traceback (most recent call last):
      File "/home/dhuck/projects/notebooks/COVID/update.py", line 466, in <module>
        main()
      File "/home/dhuck/projects/notebooks/COVID/update.py", line 456, in main
        save(world, world_file)
      File "/home/dhuck/projects/notebooks/.env/lib/python3.6/site-packages/altair_saver/_core.py", line 157
    +, in save
        Saver = _select_saver(method, mode=mode, fmt=fmt, fp=fp)
      File "/home/dhuck/projects/notebooks/.env/lib/python3.6/site-packages/altair_saver/_core.py", line 72,
    +in _select_saver
        raise ValueError(f"No enabled saver found that supports format={fmt!r}")
    ValueError: No enabled saver found that supports format='vega'
    

    This runs fine whenever I run the script as a user. I have added export DISPLAY=:0; before my script as noted here to no avail. I am calling altair_saver like so:

    world_file    = f'{PWD}/data/world_covid.vg.json'
    save(world, world_file)
    

    I attempted installing the nodeJS packages which resulted in a malformed chart.

    opened by d-huck 7
  • Cant import

    Cant import

    Sorry if its a stupid issue, but I cant import the package after installing. It asks me for a modole that should be installed with the conda instalation.

    --------------------------------------------------------------------------
    ModuleNotFoundError                       Traceback (most recent call last)
    c:\Users\Harari\Documents\GitHub\MarketSimulation\V3_Economy\main.py in 
    ----> 1 from altair_saver import save
    
    ~\Anaconda3\lib\site-packages\altair_saver\__init__.py in 
          1 """Tools for saving altair charts"""
    ----> 2 from ._core import render, save
          3 from .savers import Saver, BasicSaver, HTMLSaver, NodeSaver, SeleniumSaver
          4 
          5 __version__ = "0.1.0"
    
    ~\Anaconda3\lib\site-packages\altair_saver\_core.py in 
          3 import altair as alt
          4 
    ----> 5 from altair_saver.savers import (
          6     Saver,
          7     BasicSaver,
    
    ~\Anaconda3\lib\site-packages\altair_saver\savers\__init__.py in 
          1 from ._saver import Saver
          2 from ._basic import BasicSaver
    ----> 3 from ._html import HTMLSaver
          4 from ._node import NodeSaver
          5 from ._selenium import SeleniumSaver
    
    ~\Anaconda3\lib\site-packages\altair_saver\savers\_html.py in 
          5 from altair_saver.savers import Saver
          6 from altair_saver._utils import JSONDict, Mimebundle, fmt_to_mimetype
    ----> 7 from altair_viewer import get_bundled_script
          8 
          9 HTML_TEMPLATE = """
    
    ~\Anaconda3\lib\site-packages\altair_viewer\__init__.py in 
          4 __all__ = ["ChartViewer", "display", "render", "show", "get_bundled_script"]
          5 
    ----> 6 from altair_viewer._viewer import ChartViewer
          7 from altair_viewer._scripts import get_bundled_script
          8 
    
    ~\Anaconda3\lib\site-packages\altair_viewer\_viewer.py in 
          6 
          7 import altair as alt
    ----> 8 from altair_data_server import Provider, Resource
          9 from altair_viewer._scripts import get_bundled_script
         10 from altair_viewer._event_provider import EventProvider, DataSource
    
    ~\Anaconda3\lib\site-packages\altair_data_server\__init__.py in 
          9 ]
         10 
    ---> 11 from ._altair_server import AltairDataServer, data_server, data_server_proxied
         12 from ._provide import Provider, Resource
    
    ~\Anaconda3\lib\site-packages\altair_data_server\_altair_server.py in 
          4 from urllib import parse
          5 
    ----> 6 from altair_data_server._provide import Provider, Resource
          7 from altair.utils.data import (
          8     _data_to_json_string,
    
    ~\Anaconda3\lib\site-packages\altair_data_server\_provide.py in 
         29 import tornado.wsgi
         30 
    ---> 31 from altair_data_server import _background_server
         32 
         33 
    
    ~\Anaconda3\lib\site-packages\altair_data_server\_background_server.py in 
         20 import threading
         21 
    ---> 22 import portpicker
         23 import tornado
         24 import tornado.web
    
    ModuleNotFoundError: No module named 'portpicker'
    
    opened by ndharari 7
  • Unable to save chart

    Unable to save chart

    Hi, I am saving svg's using altair_saver in my code, and up until a few minutes ago, everything was fine. But now I am getting the following error message:

    No enabled saver found that supports format='svg'.

    Is there anything broken?

    opened by ibrahima12 5
  • Chart.save produces different colors between html, png, and svg, not using enabled theme

    Chart.save produces different colors between html, png, and svg, not using enabled theme

    Hello, I'm using altair 4.0.1 and produce a chart using alt.themes.enable('fivethirtyeight')

    When I use chart.save('foo.html') it uses the colors and layout from the theme that looks something like this (cropped oddly due to data sensitivity)

    image

    But when I use chart.save('foo.png') or chart.save('foo.svg'), the colors and layout are from the default theme image

    I tried looking in the docs for changing the theme on a chart and for save and couldn't find how to specify the theme when saving pngs and svgs.

    opened by leebrian 5
  • Not able to save anything

    Not able to save anything

    Thank you for the development of this!

    I have this sample code:

    import pandas as pd
    import altair as alt
    from altair_saver import save
    
    df = pd.read_csv("tmp.csv",keep_default_na=False)
    
    df['year'] = pd.to_datetime(df['year'], format='%Y')
    
    chart=alt.Chart(df).mark_area().encode(
        alt.X('year:T', timeUnit = 'year',title='year',axis=alt.Axis(tickCount='year')),
        alt.Y('v:Q',axis=alt.Axis(format='%'),title='percentage'),
        color='i:N'
    )
    
    save(chart, "chart.png")
    

    If I run it, I have

    Traceback (most recent call last):
      File "/mnt/c/Users/aborr/Documents/GitHub/f-dss_report/blackboard/p.py", line 15, in <module>
        save(chart, "chart.png")
      File "/home/aborruso/.local/lib/python3.9/site-packages/altair_saver/_core.py", line 169, in save
        Saver = _select_saver(method, mode=mode, fmt=fmt, fp=fp)
      File "/home/aborruso/.local/lib/python3.9/site-packages/altair_saver/_core.py", line 67, in _select_saver
        if s.enabled() and fmt in s.valid_formats[mode]:
      File "/home/aborruso/.local/lib/python3.9/site-packages/altair_saver/savers/_node.py", line 103, in enabled
        return bool(exec_path("vl2vg") and exec_path("vg2png"))
      File "/home/aborruso/.local/lib/python3.9/site-packages/altair_saver/savers/_node.py", line 29, in exec_path
        for path in [None, npm_bin(global_=True), npm_bin(global_=False)]:
      File "/home/aborruso/.local/lib/python3.9/site-packages/altair_saver/savers/_node.py", line 24, in npm_bin
        return check_output_with_stderr(cmd).decode().strip()
      File "/home/aborruso/.local/lib/python3.9/site-packages/altair_saver/_utils.py", line 198, in check_output_with_stderr
        ps = subprocess.run(
      File "/usr/lib/python3.9/subprocess.py", line 528, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command '['/home/aborruso/.nvm/versions/node/v16.18.1/bin/npm', 'bin', '--global']' returned non-zero exit status 1.
    

    I have no idea on how to solve it

    opened by aborruso 4
  • Missing chromedriver.exe on Windows results in cryptic JSONDecodeError error

    Missing chromedriver.exe on Windows results in cryptic JSONDecodeError error

    I tried to run code I had written Linux in a Windows & Conda environment. When trying to save a chart to SVG, I got a JSONDecodeError:

    ---------------------------------------------------------------------------
    JSONDecodeError                           Traceback (most recent call last)
    <ipython-input-23-be5f964fdbaf> in <module>
         12 
         13     chart = make_plot(df, foo, bar)
    ---> 14     chart.save(filepath, format="svg")
         15     ...
         16     
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\site-packages\altair\vegalite\v4\api.py in save(self, fp, format, override_data_transformer, scale_factor, vegalite_version, vega_version, vegaembed_version, **kwargs)
        474         if override_data_transformer:
        475             with data_transformers.disable_max_rows():
    --> 476                 result = save(**kwds)
        477         else:
        478             result = save(**kwds)
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\site-packages\altair\utils\save.py in save(chart, fp, vega_version, vegaembed_version, format, mode, vegalite_version, embed_options, json_kwds, webdriver, scale_factor, **kwargs)
        110         write_file_or_filename(fp, mimebundle["text/html"], mode="w")
        111     elif format in ["png", "svg"]:
    --> 112         mimebundle = spec_to_mimebundle(
        113             spec=spec,
        114             format=format,
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\site-packages\altair\utils\mimebundle.py in spec_to_mimebundle(spec, format, mode, vega_version, vegaembed_version, vegalite_version, **kwargs)
         58                 "see http://github.com/altair-viz/altair_saver/".format(fmt=format)
         59             )
    ---> 60         return altair_saver.render(spec, format, mode=mode, **kwargs)
         61     if format == "html":
         62         html = spec_to_html(
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\site-packages\altair_saver\_core.py in render(chart, fmts, mode, embed_options, method, **kwargs)
        255         Saver = _select_saver(method, mode=mode, fmt=fmt)
        256         saver = Saver(spec, mode=mode, embed_options=embed_options, **kwargs)
    --> 257         mimebundle.update(saver.mimebundle(fmt))
        258 
        259     return mimebundle
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\site-packages\altair_saver\savers\_saver.py in mimebundle(self, fmts)
         88                 vegalite_version=self._package_versions["vega-lite"],
         89             )
    ---> 90             bundle[mimetype] = self._serialize(fmt, "mimebundle")
         91         return bundle
         92 
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\site-packages\altair_saver\savers\_node.py in _serialize(self, fmt, content_type)
        112 
        113         if self._mode == "vega-lite":
    --> 114             spec = self._vl2vg(spec)
        115 
        116         if fmt == "vega":
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\site-packages\altair_saver\savers\_node.py in _vl2vg(self, spec)
         66             [vl2vg], input=vl_json, stderr_filter=self._stderr_filter
         67         )
    ---> 68         return json.loads(vg_json)
         69 
         70     def _vg2png(self, spec: JSONDict) -> bytes:
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\json\__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
        355             parse_int is None and parse_float is None and
        356             parse_constant is None and object_pairs_hook is None and not kw):
    --> 357         return _default_decoder.decode(s)
        358     if cls is None:
        359         cls = JSONDecoder
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\json\decoder.py in decode(self, s, _w)
        335 
        336         """
    --> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
        338         end = _w(s, end).end()
        339         if end != len(s):
    
    ~\AppData\Local\Continuum\anaconda3\envs\rwa\lib\json\decoder.py in raw_decode(self, s, idx)
        353             obj, end = self.scan_once(s, idx)
        354         except StopIteration as err:
    --> 355             raise JSONDecodeError("Expecting value", s, err.value) from None
        356         return obj, end
    
    JSONDecodeError: Expecting value: line 2 column 1 (char 2)
    

    This seems to have been caused by a missing setup for the chromedriver.

    It worked once I had installed and set up everything, validating by using an example that should open a Browser:

    from selenium import webdriver
    browser = webdriver.Chrome()
    browser.get('https://jupyter.org/')
    

    For me the steps were:

    • conda install -c conda-forge python-chromedriver-binary
    • And grabbing the latest stable https://sites.google.com/a/chromium.org/chromedriver/home
      • I assume that the python-chromedriver-binary should include it but it did not fix the issue and this is Windows and Conda so 🤷...

    Now it works.

    Posting here so future MEs will find it via Google.

    opened by kannes 4
  • What's the best way to render pngs in notebook

    What's the best way to render pngs in notebook

    I'm wondering what the best way is to setup altair to always render pngs.

    I'm working in jupyter-lab.

    I want my notebooks to be readable on github by default.

    At the moment, I'm using this little show method:

    import tempfile
    from IPython.display import Image
    
    def show(chart):
        file = tempfile.mktemp(suffix='.png')
        chart.save(file)
        return Image(file)
    
    question 
    opened by birdsarah 4
  • Fontconfig Error - Fonts fail to render

    Fontconfig Error - Fonts fail to render

    Hello,

    I am having an issue with saving altair charts after doing an install with conda on a miniconda3 docker image. The versions I am using are: altair 4.1.0 and altair_saver 0.5.0

    This error is thrown when the chart is saved: Fontconfig error: Cannot load default config file

    The resulting png when using the Window Rank Example then contains square symbols instead of the expected characters. test

    I expect this is due to the fonts in this docker image being installed different than other systems, but other packages seem to be able to handle this and find the fonts which are indeed available in the underlying Debian Image.

    This issue is not present when saving to html, but with png, svg and pdf.

    opened by kykrueger 3
  • save chart using method

    save chart using method "node" not running anymore with npm@9

    Saving a chart as .png causes an "CalledProcessError" error when using method "node" and npm version is node@9

    Reason is that npm has removed command: "npm bin" since version 9 which is used in _node.py (npm_bin)

    opened by mhombrecher 0
  • Garbled characters when exporting to PNG format

    Garbled characters when exporting to PNG format

    Chinese fonts are displayed normally in HTML format. Garbled characters when exporting to PNG format.

    `import pandas as pd import altair as alt from altair_saver import save

    df = pd.DataFrame({"x":[0.5,1,2], "y" : [0.5,1,2], "text": ["你好", "中国", "明天"]})

    pic = alt.Chart(df).mark_text().encode( x = "x", y= 'y', text ='text' ) save(pic, "text.png")`

    opened by Hongqing-Hu 0
  • Specify geckodriver for saving once in file?

    Specify geckodriver for saving once in file?

    Is there anyway to set the webdriver parameter one time so that all save("chart.png") calls behave like save("chart.png", webdriver="firefox")?

    I couldn't find this parameter documented on the site or the repo.

    Further, my geckodriver log mentions "Missing chrome" which may be related:

    1659451959509	geckodriver	INFO	Listening on 127.0.0.1:43221
    1659451960014	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "34867" "-no-remote" "-profile" "/tmp/rust_mozprofile6nAKtY"
    *** You are running in headless mode.
    1659451960547	Marionette	INFO	Marionette enabled
    1659451960551	Marionette	INFO	Listening on port 37075
    WebDriver BiDi listening on ws://localhost:34867
    1659451960662	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofile6nAKtY/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:34867/devtools/browser/4ffd4eb8-86d2-4a8b-bf91-65d49095b992
    1659451962223	Marionette	INFO	Stopped listening on port 37075
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    console.error: services.settings: 
      main/query-stripping Signature failed  TypeError: NetworkError: Network request failed
    1659452043194	geckodriver	INFO	Listening on 127.0.0.1:47067
    1659452043700	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "51391" "-no-remote" "-profile" "/tmp/rust_mozprofileEklnxv"
    *** You are running in headless mode.
    1659452044176	Marionette	INFO	Marionette enabled
    1659452044180	Marionette	INFO	Listening on port 34497
    WebDriver BiDi listening on ws://localhost:51391
    1659452044288	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofileEklnxv/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:51391/devtools/browser/069b6eab-ad66-4a53-ae7d-41ec3cbda8b7
    1659452045937	Marionette	INFO	Stopped listening on port 34497
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    1659452188125	geckodriver	INFO	Listening on 127.0.0.1:55165
    1659452188631	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "55793" "-no-remote" "-profile" "/tmp/rust_mozprofilefb38UI"
    *** You are running in headless mode.
    1659452189096	Marionette	INFO	Marionette enabled
    1659452189100	Marionette	INFO	Listening on port 46573
    WebDriver BiDi listening on ws://localhost:55793
    1659452189210	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofilefb38UI/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:55793/devtools/browser/638b53b0-8cc4-474b-9cc6-8e83ebf0dce1
    1659452190733	Marionette	INFO	Stopped listening on port 46573
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    console.error: services.settings: 
      main/query-stripping Signature failed  TypeError: NetworkError: Network request failed
    Sandbox: Unexpected EOF, op 0 flags 00 path /proc/cpuinfo
    1659452385361	geckodriver	INFO	Listening on 127.0.0.1:49513
    1659452385871	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "56497" "-no-remote" "-profile" "/tmp/rust_mozprofilema6R3H"
    *** You are running in headless mode.
    1659452386330	Marionette	INFO	Marionette enabled
    1659452386334	Marionette	INFO	Listening on port 34623
    WebDriver BiDi listening on ws://localhost:56497
    1659452386443	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofilema6R3H/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:56497/devtools/browser/09789d9b-ed9e-46b6-b257-b3f78924db41
    1659452387506	Marionette	INFO	Stopped listening on port 34623
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    1659453992531	geckodriver	INFO	Listening on 127.0.0.1:57613
    1659453993039	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "60641" "-no-remote" "-profile" "/tmp/rust_mozprofileuaYa4t"
    *** You are running in headless mode.
    1659453993475	Marionette	INFO	Marionette enabled
    1659453993482	Marionette	INFO	Listening on port 40759
    WebDriver BiDi listening on ws://localhost:60641
    1659453993640	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofileuaYa4t/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:60641/devtools/browser/9014982d-114f-4882-8c88-4c9ade1562ea
    1659453995305	Marionette	INFO	Stopped listening on port 40759
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    console.error: services.settings: 
      main/query-stripping Signature failed  TypeError: NetworkError: Network request failed
    console.error: Region.jsm: "Error fetching region" (new TypeError("NetworkError when attempting to fetch resource.", ""))
    console.error: Region.jsm: "Failed to fetch region" (new Error("NO_RESULT", "resource://gre/modules/Region.jsm", 421))
    JavaScript error: resource://gre/modules/TerminatorTelemetry.jsm, line 69: AbortError: IOUtils: Shutting down and refusing additional I/O tasks
    1659457011204	geckodriver	INFO	Listening on 127.0.0.1:60811
    1659457011711	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "48955" "-no-remote" "-profile" "/tmp/rust_mozprofileseoGNF"
    *** You are running in headless mode.
    1659457012161	Marionette	INFO	Marionette enabled
    1659457012165	Marionette	INFO	Listening on port 45167
    WebDriver BiDi listening on ws://localhost:48955
    1659457012272	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofileseoGNF/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:48955/devtools/browser/ced63948-e904-46d0-a0f7-7a68ac7557d4
    1659457013687	Marionette	INFO	Stopped listening on port 45167
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    console.error: services.settings: 
      main/query-stripping Signature failed  TypeError: NetworkError: Network request failed
    console.error: services.settings: 
      main/quicksuggest Signature failed  TypeError: NetworkError: Network request failed
    Sandbox: Unexpected EOF, op 0 flags 00 path /proc/cpuinfo
    1659457159814	geckodriver	INFO	Listening on 127.0.0.1:33957
    1659457160322	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "34269" "-no-remote" "-profile" "/tmp/rust_mozprofileXjEB2g"
    *** You are running in headless mode.
    1659457160781	Marionette	INFO	Marionette enabled
    1659457160786	Marionette	INFO	Listening on port 37547
    WebDriver BiDi listening on ws://localhost:34269
    1659457160894	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofileXjEB2g/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:34269/devtools/browser/9b8aa728-eada-48e1-a0a7-8d19b298e1bb
    1659457162755	Marionette	INFO	Stopped listening on port 37547
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    JavaScript error: resource://services-settings/RemoteSettingsWorker.jsm, line 145: Error: Shutdown, aborting read-only worker requests.
    1659457264832	geckodriver	INFO	Listening on 127.0.0.1:57477
    1659457265340	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "51395" "-no-remote" "-profile" "/tmp/rust_mozprofileOJUtTt"
    *** You are running in headless mode.
    1659457265837	Marionette	INFO	Marionette enabled
    1659457265842	Marionette	INFO	Listening on port 35329
    WebDriver BiDi listening on ws://localhost:51395
    1659457266111	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofileOJUtTt/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:51395/devtools/browser/7b77ea9a-6b41-47fe-af4a-445c2f2c42fe
    1659457267688	Marionette	INFO	Stopped listening on port 35329
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    JavaScript error: resource://services-settings/RemoteSettingsWorker.jsm, line 145: Error: Shutdown, aborting read-only worker requests.
    1659463173791	geckodriver	INFO	Listening on 127.0.0.1:54749
    1659463174297	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "42975" "-no-remote" "-profile" "/tmp/rust_mozprofilej4tqod"
    *** You are running in headless mode.
    1659463174720	Marionette	INFO	Marionette enabled
    1659463174724	Marionette	INFO	Listening on port 45119
    WebDriver BiDi listening on ws://localhost:42975
    1659463174940	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofilej4tqod/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:42975/devtools/browser/b525e182-bea8-4c47-a467-4b3215419a7f
    1659463177937	Marionette	INFO	Stopped listening on port 45119
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    JavaScript error: resource://services-settings/Utils.jsm, line 240: TypeError: NetworkError: Network request failed
    1659463634209	geckodriver	INFO	Listening on 127.0.0.1:47755
    1659463634716	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "--headless" "--remote-debugging-port" "42669" "-no-remote" "-profile" "/tmp/rust_mozprofile3v8pXD"
    *** You are running in headless mode.
    1659463635148	Marionette	INFO	Marionette enabled
    1659463635152	Marionette	INFO	Listening on port 38193
    WebDriver BiDi listening on ws://localhost:42669
    1659463635299	RemoteAgent	WARN	TLS certificate errors will be ignored for this session
    [GFX1-]: RenderCompositorSWGL failed mapping default framebuffer, no dt
    console.warn: SearchSettings: "get: No settings file exists, new profile?" (new NotFoundError("Could not open the file at /tmp/rust_mozprofile3v8pXD/search.json.mozlz4", (void 0)))
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    DevTools listening on ws://localhost:42669/devtools/browser/91f3b26e-c2ba-4fd6-bd85-0c92f62c444f
    1659463638521	Marionette	INFO	Stopped listening on port 38193
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.jsm
    Missing chrome or resource URL: resource://gre/modules/UpdateListener.sys.mjs
    console.error: "Error during quit-application-granted: [Exception... \"File error: Not found\"  nsresult: \"0x80520012 (NS_ERROR_FILE_NOT_FOUND)\"  location: \"JS frame :: resource:///modules/BrowserGlue.jsm :: _onQuitApplicationGranted/tasks< :: line 2006\"  data: no]"
    JavaScript error: resource://services-settings/Utils.jsm, line 240: TypeError: NetworkError: Network request failed
    Sandbox: Unexpected EOF, op 0 flags 00 path /proc/cpuinfo
    

    altair               4.2.0
    altair-data-server   0.4.1
    altair-saver         0.5.0
    altair-viewer        0.4.0
    selenium             4.2.0
    geckodriver          0.30.0
    
    opened by mcp292 0
  • untested code change to use find_element()

    untested code change to use find_element()

    See API docs here: https://www.selenium.dev/selenium/docs/api/py/index.html?highlight=find_element

    and the SO post

    I'll have a quick look to see if there are any other changes.

    Attempts to address #104

    opened by firasm 0
Releases(v0.5.0)
  • v0.5.0(Mar 31, 2020)

    • Fix bug when running as root user on linux (#59)
    • node-based saver hides window warnings that were displayed when saving interactive charts (#53, #57)
    • node-based saver now accepts vega_cli_options that will be passed to command line (#52)
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Mar 25, 2020)

    • altair_saver.types is now a public module. (#47)
    • altair_saver.JavascriptError now importable at top-level. (#46)
    • Added top-level available_formats() function, which returns the set of available formats. (#43)
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Mar 20, 2020)

  • v0.3.0(Mar 19, 2020)

    Behavior changes

    • save() now returns the serialized chart if fp is not specified (#41).
    • fmt="json" now saves the input spec directly for both vega and vega-lite input. Additionally, the json format in render() outputs a JSON mimetype rather than a vega-lite mimetype (#34).
    • render() and save() with HTML format now have a standalone argument that defaults to True for save() and False for render(), so that HTML output will work better in a variety of notebook frontends (#33).
    • HTML and Selenium output now respects embedding options set via alt.renderers.set_embed_options (#30, #31).

    Maintenance

    • much improved documentation & test coverage.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Mar 6, 2020)

    Behavior changes

    • selenium: prefer chromedriver over geckodriver when both are available (#27)

    Bug Fixes

    • selenium: altair_saver respects altair themes (#22)
    • selenium: improve javascript-side error handling (#19)
    Source code(tar.gz)
    Source code(zip)
Owner
Altair
Declarative visualization in Python
Altair
🐞 📊 Ladybug extension to generate 2D charts

ladybug-charts Ladybug extension to generate 2D charts. Installation pip install ladybug-charts QuickStart import ladybug_charts API Documentation Loc

Ladybug Tools 3 Dec 30, 2022
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 206 Dec 12, 2022
Draw interactive NetworkX graphs with Altair

nx_altair Draw NetworkX graphs with Altair nx_altair offers a similar draw API to NetworkX but returns Altair Charts instead. If you'd like to contrib

Zachary Sailer 156 Feb 6, 2021
Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax.

PyDexter Simple plotting for Python. Python wrapper for D3xter - render charts in the browser with simple Python syntax. Setup $ pip install PyDexter

D3xter 31 Mar 6, 2021
Python library that makes it easy for data scientists to create charts.

Chartify Chartify is a Python library that makes it easy for data scientists to create charts. Why use Chartify? Consistent input data format: Spend l

Spotify 3.2k Jan 4, 2023
🧇 Make Waffle Charts in Python.

PyWaffle PyWaffle is an open source, MIT-licensed Python package for plotting waffle charts. It provides a Figure constructor class Waffle, which coul

Guangyang Li 528 Jan 2, 2023
Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js

pivottablejs: the Python module Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js Installation pip install pivot

Nicolas Kruchten 512 Dec 26, 2022
Python library that makes it easy for data scientists to create charts.

Chartify Chartify is a Python library that makes it easy for data scientists to create charts. Why use Chartify? Consistent input data format: Spend l

Spotify 2.8k Feb 18, 2021
🧇 Make Waffle Charts in Python.

PyWaffle PyWaffle is an open source, MIT-licensed Python package for plotting waffle charts. It provides a Figure constructor class Waffle, which coul

Guangyang Li 397 Feb 17, 2021
Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js

pivottablejs: the Python module Drag’n’drop Pivot Tables and Charts for Jupyter/IPython Notebook, care of PivotTable.js Installation pip install pivot

Nicolas Kruchten 419 Feb 11, 2021
Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner

streamlit-dashboards Streamlit dashboard examples - Twitter cashtags, StockTwits, WSB, Charts, SQL Pattern Scanner Tutorial Video https://ww

null 122 Dec 21, 2022
Python library that makes it easy for data scientists to create charts.

Chartify Chartify is a Python library that makes it easy for data scientists to create charts. Why use Chartify? Consistent input data format: Spend l

Spotify 3.2k Jan 1, 2023
mysql relation charts

sqlcharts 自动生成数据库关联关系图 复制settings.py.example 重命名为settings.py 将数据库配置信息填入settings.DATABASE,目前支持mysql和postgresql 执行 python build.py -b,-b是读取数据库表结构,如果只更新匹

null 6 Aug 22, 2022
GitHub English Top Charts

Help you discover excellent English projects and get rid of the interference of other spoken language.

kon9chunkit 529 Jan 2, 2023
Data-FX is an addon for Blender (2.9) that allows for the visualization of data with different charts

Data-FX Data-FX is an addon for Blender (2.9) that allows for the visualization of data with different charts Currently, there are only 2 chart option

Landon Ferguson 20 Nov 21, 2022
Visual Python is a GUI-based Python code generator, developed on the Jupyter Notebook environment as an extension.

Visual Python is a GUI-based Python code generator, developed on the Jupyter Notebook environment as an extension.

Visual Python 564 Jan 3, 2023
Time series visualizer is a flexible extension that provides filling world map by country from real data.

Time-series-visualizer Time series visualizer is a flexible extension that provides filling world map by country from csv or json file. You can know d

Long Ng 3 Jul 9, 2021
A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe which runs both payloads.

Update ! ANONFILE MIGHT NOT WORK ! About A Python Binder that merge 2 files with any extension by creating a new python file and compiling it to exe w

Vesper 15 Oct 12, 2022
`charts.css.py` brings `charts.css` to Python. Online documentation and samples is available at the link below.

charts.css.py charts.css.py provides a python API to convert your 2-dimension data lists into html snippet, which will be rendered into charts by CSS,

Ray Luo 3 Sep 23, 2021
Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes in a variety of languages.

Mimesis - Fake Data Generator Description Mimesis is a high-performance fake data generator for Python, which provides data for a variety of purposes

Isaak Uchakaev 3.8k Dec 29, 2022