How to use the vott-ct/lib/js/CanvasTools/Core/TagsDescriptor.TagsDescriptor function in vott-ct

To help you get started, we’ve selected a few vott-ct examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / VoTT / src / react / components / pages / editorPage / canvasHelpers.ts View on Github external
public static getTagsDescriptor(projectTags: ITag[], region: IRegion): TagsDescriptor {
        if (!projectTags || !projectTags.length) {
            return null;
        }
        Guard.null(region);

        const tags = region.tags
            .map((tagName) => {
                const projectTag = projectTags.find((projectTag) => projectTag.name === tagName);
                return projectTag ? new Tag(projectTag.name, projectTag.color) : null;
            })
            .filter((tag) => tag !== null);

        return new TagsDescriptor(tags);
    }