circuit-json 0.0.113 → 0.0.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +46 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -109,6 +109,52 @@ any_circuit_element.parse({
109
109
  })
110
110
  ```
111
111
 
112
+ ## Base Units
113
+
114
+ When there is not a string unit provided, tscircuit assumes the a "base unit" is used.
115
+
116
+ You can specify circuit json with string units to avoid ambiguity around
117
+ units, for example by specifying `{ max_trace_length: "100mm" }` avoids needing to know
118
+ the base unit. However if a number is specified, it should be in the base units in the
119
+ table below. In this case `{ max_trace_length: 100 }` is equivalent.
120
+
121
+ The default units when reading a number are defined as follows:
122
+
123
+ | Measurement Type | Base Unit | Description |
124
+ | ---------------- | --------- | ------------ |
125
+ | Length | mm | Millimeters |
126
+ | Time | ms | Milliseconds |
127
+ | Mass | g | Grams |
128
+ | Angle | deg | Degrees |
129
+ | Frequency | Hz | Hertz |
130
+ | Volume | ml | Milliliters |
131
+ | Voltage | V | Volts |
132
+ | Current | A | Amperes |
133
+ | Resistance | Ω | Ohms |
134
+ | Capacitance | F | Farads |
135
+ | Inductance | H | Henries |
136
+
137
+ ## Element Prefixes
138
+
139
+ Element prefixes are used to separate data that's used in different contexts. This allows
140
+ developers who use Circuit JSON to develop partial implementations with smaller targets in mind.
141
+ It can also help simplify JSON elements because schematic and pcb information is not contained
142
+ in the same object.
143
+
144
+ A single `<resistor />` (in tscircuit) will have a corresponding `source_component`, `schematic_component` and `pcb_component`, as well as other elements that may be necessary
145
+ to represent it.
146
+
147
+ There are 3 main element prefixes:
148
+
149
+ - `source_` - e.g. `source_component` An element that contains information from whatever originally defined the entity. You can think of this as a non-target representations.
150
+ - For example, you might have `supplier_part_numbers` as a property here, since that is
151
+ not strictly related to the `pcb` or the `schematic`.
152
+ - This category sometimes contains information that is relevant to both the `pcb` and the `schematic`
153
+ - This is a somewhat a "Miscellaneous" category, because it contains things from the source
154
+ definition that we wouldn't want to lose.
155
+ - `pcb_` - e.g. `pcb_component`, `pcb_port`. Anything required to render the PCB
156
+ - `schematic_` - e.g. `schematic_component`. Anything required to render the Schematic
157
+
112
158
  <!-- circuit-json-docs:start -->
113
159
 
114
160
  ## Source Components
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "circuit-json",
3
- "version": "0.0.113",
3
+ "version": "0.0.114",
4
4
  "description": "Definitions for the tscircuit intermediary JSON format",
5
5
  "main": "dist/index.mjs",
6
6
  "files": [