Skip to content
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

DOC: improvements checklist #1060

Closed
12 of 13 tasks
jakevdp opened this issue Jul 30, 2018 · 17 comments
Closed
12 of 13 tasks

DOC: improvements checklist #1060

jakevdp opened this issue Jul 30, 2018 · 17 comments

Comments

@jakevdp
Copy link
Collaborator

jakevdp commented Jul 30, 2018

There have been a number of questions from users that point to weaknesses in our docs. This issue is an attempt to compile them into a checklist.

@f0lie
Copy link

f0lie commented Aug 2, 2018

I am a bit confused on how to add documentation. Is there some sort of workflow guide for the documentation? Also standards and tips?

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 2, 2018

@adiep2501 thanks for your interest – no, there's no guide at the moment (I should add that to the checklist!)

The basics are this:

  • the source of the documentation is in the doc subdirectory
  • You can edit the RST source (for example, encoding.rst) which will be processed using sphinx to convert it to HTML (for example, encoding.html).

If you make any significant changes, it helps to render the docs locally to check that everything is working, which you can do by running make html within the doc directory (this requires you install all the packages in doc/requirements.txt)

I hope that's clear!

@f0lie
Copy link

f0lie commented Aug 2, 2018

So I tried to follow your instructions and it turns out it's a bit more complicated.

Here's the instructions for a MacOS. It actually doesn't work but it's most of the way there.

$ git clone https://github.com/altair-viz/altair
$ brew cask install chromedriver
$ cd altair
$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt -r requirements_dev.txt -r doc/requirements.txt
$ cd doc
$ make html

I get a selenium error selenium.common.exceptions.JavascriptException: Message: javascript error: vl is not defined. Googling doesn't get me anything useful.

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 2, 2018

vl here is the vega-lite library, which is loaded from the web by selenium. Is it possible that your selenium engine is somehow being blocked from accessing the internet?

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 2, 2018

(also, FYI the only thing selenium is used for here is generating thumbnails for the example gallery. You may be able to build the rest of the site without it)

@f0lie
Copy link

f0lie commented Aug 2, 2018

I am working in an corporate environment so it's probably blocked. How do I build without selenium? I am just trying to see the graphs that are produced.

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 2, 2018

Hmm... I don't think there's any built-in way to avoid it at the moment, but you could probably comment-out this line to do it: https://github.com/altair-viz/altair/blob/88ec1e01188f4c46d4d686522ca3fc1a881339f3/altair/sphinxext/altairgallery.py#L129

A better solution long-term might be to add logic to catch errors in that line and save a blank place-holder image instead, so that docs could be built without example thumbnails.

@f0lie
Copy link

f0lie commented Aug 2, 2018

  File "/Users/user/altair/venv/lib/python3.7/site-packages/PIL/Image.py", line 2580, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/Users/user/altair/doc/_images/anscombe_plot.png'

Still getting an error, looks like something somewhere expects the file to be written.

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 2, 2018

Right, you'll have to create a stand-in image somehow.

@f0lie
Copy link

f0lie commented Aug 2, 2018

Maybe I could just figure out how to make selenium use the proxy?

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 2, 2018

Here's a PR that uses a stand-in thumbnail when selenium is not available: #1066

Note, it depends on catching an ImportError so it's best to use this with selenium not installed.

@jimmywan
Copy link
Contributor

jimmywan commented Aug 3, 2018

Any chance that we could add an example for blending map data with a dataframe containing WGS84 coordinates already in it?

This was a snippet from my admittedly extremely naive attempt at just slapping a backing US map on a scatter plot using longitude/latitude as X/Y:
image

counties = alt.topo_feature(data.us_10m.url, 'counties')
background = alt.Chart(counties).mark_geoshape(
    fill='#666666',
    stroke='white'
).encode(
).project(
    type='equirectangular'
)

background + chart

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 4, 2018

You should be able to use the latitude and longitude encodings, like in this example: https://altair-viz.github.io/gallery/airports.html

kindofluke pushed a commit to kindofluke/altair that referenced this issue Aug 6, 2018
… improvements to demonstrate column and legend sorting.

Documentation includes two new examples showing how encoded channels can be sorted based on their data type or with an explicit order.
@kindofluke
Copy link
Contributor

I just opened a PR for adding documentation on Sort to the user guide.

@kindofluke
Copy link
Contributor

kindofluke commented Aug 16, 2018

@jakevdp just started on binding. You can feel free to take a look in the branch binding-documentation

this has been my approach:

  • With adding input elements and bindings the page should just be called interactions.
  • Add simple dropdown example
  • add an example using filter
  • enumerate all of the avail input elements.
  • bind to "scales" magic for panning and zooming
  • headers are all out of wack
  • spelling and proofread

@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 16, 2018

@kindofluke this looks great! Feel free to open a pull request even if it's still a work in progress – it makes it easier to track commits and see diffs.

@kindofluke kindofluke mentioned this issue Aug 23, 2018
7 tasks
@jakevdp
Copy link
Collaborator Author

jakevdp commented Aug 29, 2018

Aside from the type syntax, we've checked all the boxes now! As it's not clear how that last one will be solved, I'm going to go ahead and close this issue

@jakevdp jakevdp closed this as completed Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants