Skip to content

Commit

Permalink
chore(widget): update comments and readme heading levels
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewedstrom committed Nov 22, 2023
1 parent 019dd63 commit f08abce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/widget/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

An embeddable widget for displaying Docmaps data, built with Lit and D3.

## Usage
# Usage

The widget can be retrieved via CDN, or via NPM if your project already uses NPM.

Expand Down Expand Up @@ -44,7 +44,7 @@ These attributes can be added to the `<docmaps-widget>` tag to configure the wid
| `doi` | The DOI of the paper to render |
| `serverurl` | The URL of the server from which the docmap will be fetched. The widget will make a request to this server's `GET /docmap_for/doi?subject={doi}` endpoint, which must be implemented by the server in accordance with the [official Docmaps API spec](https://github.com/Docmaps-Project/rfcs/blob/ships/1/APIProtocol/proposals/001_interop.md#convenience-endpoints-for-one-shot-noninteractive-docmap-retrieval). |

## Screenshots
# Screenshots

Graph view:

Expand All @@ -54,7 +54,7 @@ Clicking a node opens the detail view:

![Screenshot of the widget's detailview](./images-for-readme/detail-view.jpeg)

## Development
# Development

### Running the server locally

Expand Down
3 changes: 2 additions & 1 deletion packages/widget/src/docmap-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ function thingToDisplayObject(
return {
nodeId,
type: displayType,
// these fields should not be present if they are unset
// The rest of the fields should not be set if they are undefined.
// Omitting undefined fields entirely lets us more easily merge display objects
...(thing.doi ? { doi: thing.doi } : {}),
...(thing.id ? { id: thing.id } : {}),
...(published ? { published } : {}),
Expand Down

0 comments on commit f08abce

Please sign in to comment.