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

Reading private ele data is OK, but renderer data is not #2

Open
maxkfranz opened this issue Nov 24, 2014 · 4 comments
Open

Reading private ele data is OK, but renderer data is not #2

maxkfranz opened this issue Nov 24, 2014 · 4 comments

Comments

@maxkfranz
Copy link

Reading private element data is fine and necessary. However, I would be hesitant to read private renderer data, as compatibility could easily break with changes to the renderer. Consider that the renderer could be subject to refactoring, API changes, changes in rendering technology, etc.

@wehriam
Copy link
Owner

wehriam commented Nov 24, 2014

Where am I reading private renderer data?

I assume you're referring to the last line of the following:

    var CanvasRenderer = $$.extension('renderer', 'canvas');
    function CssRenderer(options){
      CanvasRenderer.call(this, options);
      this.data.cssContainer = document.createElement('div');
      this.data.cssContainer.className = "cssContainer";
      this.data.cssContainer.style = $$.util.extend(this.data.cssContainer.style, {
        postion: "absolute",
        top: 0,
        right: 0,
        bottom: 0,
        left: 0
      });
      this.data.container.appendChild( this.data.cssContainer );
    }
    CssRenderer.prototype = Object.create(CanvasRenderer.prototype);
    CssRenderer.prototype.constructor = CssRenderer;
    $$.util.extend(CssRenderer, CanvasRenderer);

The CanvasRenderer class has a number of properties that are assigned prior to instantiation, is that what you're referring to?

@maxkfranz
Copy link
Author

Accessing the shared data object in that case may be problematic, but considering #3 this issue is probably redundant. Just wanted to make sure I wrote down all my initial thoughts so they wouldn't be lost.

@wehriam
Copy link
Owner

wehriam commented Nov 26, 2014

Thank you for the feedback.

I need to push forward on the project I'm using this in, but should be revisiting the codebase soon.

@maxkfranz
Copy link
Author

Cool; good luck with your project.

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

No branches or pull requests

2 participants