wavedrom / bitfield

:cake: bit field diagram renderer
MIT License
334 stars 27 forks source link

compact mode attributes #25

Open drom opened 4 years ago

drom commented 4 years ago

@nopeslide I have updated wavedrom.com to support compact mode. #23

{reg:[
  {name: 'IPO',   bits: 8, attr: 'RO', type: 6},
  {               bits: 7},
  {name: 'BRK',   bits: 5, attr: 'RW', type: 4},
  {name: 'CPK',   bits: 1 },
  {name: 'Clear', bits: 3 },
  {bits: 8 }
], config: {lanes: 4, compact: true}}

One issue is the field attributes. (RO, RW) In example above. Do you have ideas how we can place attributes in the compact mode?

nopeslide commented 4 years ago

@drom I don't think there is an elegant way to support attributes in the compact mode, except for just breaking it up. Even multilines rendered normally have issues placing them right. I think a dynamic spacing (dependent on the number of attributes) between the lines could solve the general multiline attribute issue.

gabrielrad commented 4 years ago

@drom I believe tooltips are a good way to solve this: 1111111111111

I have issues with names overlapping and also want to represent more informations about the fields like the reset value and so on..

drom commented 4 years ago

Tooltips are OK solution for HTML but not for PDF.

drom commented 4 years ago

Here is another style with extension lines.

RB

regmap

LB

regmap001

LU

regmap002

drom commented 4 years ago

Example with rotated and abbreviated field names.

regmap003