Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(timeline): add an option to make the custom marker editable #117

Merged
merged 6 commits into from
Oct 4, 2019
Merged

feat(timeline): add an option to make the custom marker editable #117

merged 6 commits into from
Oct 4, 2019

Conversation

ryamaguchi0220
Copy link
Contributor

@ryamaguchi0220 ryamaguchi0220 commented Oct 2, 2019

const marker = document.createElement('div');
marker.className = `vis-custom-time-marker`;
marker.innerHTML = title;
marker.style.position = 'absolute';
if (editable) {
marker.setAttribute('contenteditable', 'true');
marker.addEventListener('pointerdown', function () {
Copy link
Contributor Author

@ryamaguchi0220 ryamaguchi0220 Oct 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing focus() is necessary since the default is prevented by here.
If you have any better ideas, please share it.

Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
Could you please also add a new example that demonstrates the use of this new feature.

@ryamaguchi0220
Copy link
Contributor Author

ryamaguchi0220 commented Oct 4, 2019

@mojoaxel
I've added the new examples 😉

@@ -0,0 +1,50 @@
<!DOCTYPE HTML>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example file needs to be added to the example overview.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4a52f8b

@@ -0,0 +1,41 @@
<!DOCTYPE HTML>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example file needs to be added to the example overview.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4a52f8b


<script type="text/javascript">
var container = document.getElementById('visualization');
var items = new vis.DataSet();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if some dummy-data would be displayed.
Something like this

var items = [
    {x: '2014-06-11', y: 10},
    {x: '2014-06-12', y: 25},
    {x: '2014-06-13', y: 30},
    {x: '2014-06-14', y: 10},
    {x: '2014-06-15', y: 15},
    {x: '2014-06-16', y: 30}
  ];
  var dataset = new vis.DataSet(items);

Copy link
Contributor Author

@ryamaguchi0220 ryamaguchi0220 Oct 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so too.
However, I'm not sure if it would be nice to use vis.Graph2d instead of vis.Timeline like this since these examples are the timeline documents, not the graph2d documents.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are write, I copied the wrong example code. Feel free to add some data-points or leave it as it is.


<script type="text/javascript">
var container = document.getElementById('visualization');
var items = new vis.DataSet();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add some dummy-data (see above).

Comment on lines 33 to 34
var id1 = "foo";
var id2 = "bar";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9cf487a

Copy link
Member

@mojoaxel mojoaxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yotamberk yotamberk merged commit 46ea275 into visjs:master Oct 4, 2019
@ryamaguchi0220 ryamaguchi0220 deleted the issue/105 branch October 5, 2019 12:40
@mojoaxel mojoaxel mentioned this pull request Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option to make a custom time marker title editable
3 participants