Coder Social home page Coder Social logo

pinout-overview-lib's Introduction

Pinout Overview Library

pinout diagram library using Python and drawsvg

A heavily reworked fork of pinout-overview into a library by stripping out all parts unrelated to the pinout and legend objects themselves.

Note: At this point documentation is more conceptual than literal. See dx-pinouts repository for a working example. The library docstrings are fairly helpful.

Dependencies

Uses the DrawSVG library for drawing the svg elements

Install

mkdir <project-master>
cd <project-master>
python -m venv --prompt <my-prompt> venv
source venv/bin/activate
git clone github.com/coburnw/pinout-overview
cd pinout-overview
git checkout lib
pip install --editable .

Usage

Subclass the following:

  1. Function() Create a subclass for each function that may be displayed in a pinout.
    Override any style attributes to customise the functions visual, and any exposed methods to parse the format of the source data.
  2. Pinmap() A mapping of pin numbers to Pad objects.
    Add a method to parse the source data, instantiating a Function object for each, and appending to the proper Pad.
  3. Package() messy

instantiate a Pinmap, parse the device data for pad/function relationships and append.

parse the device data for package shapes and pincounts and instantiate a Package.

Choose a layout: 'horizontal', 'diagonal' or 'orthogonal', instantiate a Pinout(layout, package, pinmap) object and place

Choose a layout: 'horizontal' or 'vertical' instantiate a Legend(layout, pinmap) object and place

Exposed Classes

Region() A subclass of the DrawSVG Group

  • Adds simplistic knowledge of a regions size and position. Since Pinout and Legend are derived from Region the application can use their 'width', 'height', 'x' and 'y' attributes to dynamically help with size and placement of other items on the page.

Function() A single function label

  • The primary visual effect of interest. A container for a functions data to be visually represented on a page ultimately associated with some pin.

Functions() A single row of function labels with a connecting line

  • rarely needed by the library user.

Pad(pad_name) A group of functions assigned to a specific pad

  • rarely needed by the library user.

Pinmap([pad_names]) A mapping of pin numbers to Pad's

  • The pad name list must be in order and without any missing pins.

PackageData() A container for package data

  • This should be moved to a package subclass

Package() a displayable package

  • QFP, QFN, or SOP

Pinout(layout, pinmap, package) A package with pad fanout

  • layout (str): 'horizontal', 'diagonal', or 'orthogonal'
  • pinmap (Pinmap): an initialized Pinmap object
  • package (Package): an initialized Package object

Legend(layout, pinmap) describes function types

  • layout (str): Vertical or Horizontal
  • pinmap (Pinmap):

Config Files

There are no config files. Configuration is done by subclassing and overriding.

Scaling

The size of the function label determines the scale of many of the objects. Override the functions width and height attributes.

TODO

  • legend

  • merge changes to qfp and sop packages

  • add split option

  • handle quadrant text internally rather than asking the browser to render it

  • expand on label size for object scaling

  • Error checking

  • Documentation

  • Improve modularity to allow for more complex footprints

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.