Skip to content

Commit

Permalink
better way for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MauriceConrad committed Apr 13, 2024
1 parent b607b8a commit d68f2f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 162 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Copy README to vue project
run: cp README.md zoompinch-vue/README.md

- name: Build and publish
working-directory: zoompinch-vue
run: npm run build
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ $ npm install zoompinch
### Example usage

```typescript
import { ProjectionLayer } from 'zoompinch';
import { Zoompinch } from 'zoompinch';
import 'zoompich/style.css';

// Just the ref instance in which the component instance will live
const projectionLayerRef = ref<InstanceType<typeof ProjectionLayer>>();
const zoompinchRef = ref<InstanceType<typeof ProjectionLayer>>();

// A reactive transform object
const transform = ref({
Expand All @@ -24,15 +24,15 @@ const transform = ref({
});

function handleClickOnLayer(event: MouseEvent) {
const [x, y] = projectionLayerRef.value?.normalizeMatrixCoordinates(event.clientX, event.clientY);
const [x, y] = zoompinchRef.value?.normalizeMatrixCoordinates(event.clientX, event.clientY);

console.log('clicked at', x, y);
}
```

```vue
<projection-layer
ref="projectionLayerRef"
<zoompinch
ref="zoompinchRef"
v-model:transform="transform"
:width="1536"
:height="2048"
Expand All @@ -55,7 +55,7 @@ function handleClickOnLayer(event: MouseEvent) {
<circle :cx="composePoint(0.5, 0.5)[0]" :cx="composePoint(0.5, 0.5)[1]" r="5" style="fill: #f00;" />
</svg>
</template>
</projection-layer>
</zoompinch>
```

#### Properties
Expand Down
155 changes: 0 additions & 155 deletions zoompinch-vue/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion zoompinch-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zoompinch",
"private": false,
"version": "0.0.9",
"version": "0.0.10",
"type": "module",
"files": [
"package.json",
Expand Down

0 comments on commit d68f2f4

Please sign in to comment.