Skip to content

Proposal for better Output and Rendering Design #622

@fpliger

Description

@fpliger

Checklist

  • I added a descriptive title
  • I searched for other feature requests and couldn't find a duplicate (including also the type-feature tag)
  • I confirmed that it's not related to another project area (see the above section)

What is the idea?

We need a strong[er] Design for our overall output and rendering API and application flow. "Traditional" python application happen in a console, where the medium for both is the console. PyScript is to be considered a GUI Application where, in most cases, the place for output vs display is different.

Why is this needed

Our current design is confusing and not user friendly. Some of the reasons are that:

  • it doesn't separate the concept of output from display. output mixes both and, while allows to explicitly write to both separately (by outputting to console and using write to write to DOM)
  • the default behavior is confusing
  • options to customize are not enough
  • documentation is bad or missing

What should happen?

  • print
    • Should escape (by default)
    • Is not intended for rich outputs (e.g. repr_svg)
    • By default you print to JS console
    • In debug mode we have a nice console that is visible by default
  • render/display function
    • Intended for rich output like IPython global display
    • Probably also escapes strings
    • By default renders in-place but can also have a target (and can be overridden by output attribute on py-script tag)
      No consensus on default tag last line output behavior

Additional Context

Child Issues

Issues Impacted:

Metadata

Metadata

Assignees

Labels

epica highlevel collection of smaller related issuestype: featureNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

Status
Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions