Skip to content

Commit

Permalink
Fix narrow property tables and shorten navbar titles (#2746)
Browse files Browse the repository at this point in the history
* Fix typo in function name

* Restrict max-width of type definition column to 200px

* Reduce max-width for vl-tep-def column and clip overflow. Set max-width for sidebar to 20%

* Shorten titles
  • Loading branch information
binste authored Dec 9, 2022
1 parent 37ef2f7 commit 541bc58
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
6 changes: 3 additions & 3 deletions altair/sphinxext/schematable.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def build_row(item):
is_text = not is_text

# row += nodes.entry('')
row += nodes.entry("", par_type) # , classes=["vl-type-def"]
row += nodes.entry("", par_type, classes=["vl-type-def"])

# Description
md_parser = CommonMarkParser()
Expand All @@ -133,7 +133,7 @@ def build_row(item):
return row


def build_schema_tabel(items):
def build_schema_table(items):
"""Return schema table of items (iterator of prop, schema.item, required)"""
table, tbody = prepare_table_header(
["Property", "Type", "Description"], [10, 20, 50]
Expand Down Expand Up @@ -161,7 +161,7 @@ def select_items_from_schema(schema, props=None):

def prepare_schema_table(schema, props=None):
items = select_items_from_schema(schema, props)
return build_schema_tabel(items)
return build_schema_table(items)


def validate_properties(properties):
Expand Down
9 changes: 9 additions & 0 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ table.docutils td li {

}

table td.vl-type-def {
max-width: 170px;
overflow-x: clip;
}

.bd-sidebar-primary {
max-width: 20%
}

.properties-example .vega-bind-name {
display: inline-block;
min-width: 150px;
Expand Down
4 changes: 2 additions & 2 deletions doc/user_guide/compound_charts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

.. _user-guide-compound:

Compound Charts: Layer, HConcat, VConcat, Repeat, Facet
-------------------------------------------------------
Layered and Multi-View Charts
-----------------------------
Along with the basic :class:`Chart` object, Altair provides a number of
compound plot types that can be used to create stacked, layered, faceted,
and repeated charts. They are summarized in the following tables:
Expand Down
4 changes: 2 additions & 2 deletions doc/user_guide/interactions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

.. _user-guide-interactions:

Interactive Charts: Parameters, Conditions, Bindings
====================================================
Interactive Charts
==================

One of the unique features of Altair, inherited from Vega-Lite, is a
declarative grammar of not just visualization, but *interaction*.
Expand Down
4 changes: 2 additions & 2 deletions doc/user_guide/internals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

.. _user-guide-internals:

Altair Internals: Understanding the Library
===========================================
Altair Internals
================
This section will provide some details about how the Altair API relates to the
Vega-Lite visualization specification, and how you can use that knowledge to
use the package more effectively.
Expand Down

0 comments on commit 541bc58

Please sign in to comment.